gccbuild:
for i in $(MODULES); do make -C$$i compile; done
-luabuild:
- for i in $(MODULES); do make -C$$i luabuild; done
+luabuild: i18nbuild
+ for i in $(MODULES); do HOST=$(realpath host) make -C$$i luabuild; done
+
+i18nbuild:
+ mkdir -p host/lua-po
+ ./build/i18n-po2lua.pl ./po host/lua-po
clean:
rm -rf docs
+PO = asterisk
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = coovachilli
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = ddns
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO =
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = luci-fw
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = hd_idle
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = initmgr
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = livestats
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = mmc_over_gpio
+
include ../../build/config.mk
include ../../build/module.mk
+PO = ntpc
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = olsr
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = openvpn
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = p910nd
+
include ../../build/config.mk
include ../../build/module.mk
+PO = polipo
+
include ../../build/config.mk
include ../../build/module.mk
+PO = qos
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = samba
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO =
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO =
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = statistics rrdtool
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = tinyproxy
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = upnp
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = ushare
+
include ../../build/config.mk
include ../../build/module.mk
+PO = uvc_streamer
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
{
if( open L, "< $file" )
{
- my ( $basename ) = $file =~ m{.+/([^/]+\.[\w\-]+)\.po$};
-
- if( open D, "> $target_dir/$basename.lua" )
+ my $content = 0;
+ my ( $lang, $basename ) = $file =~ m{.+/(\w+)/([^/]+)\.po$};
+ $lang = lc $lang;
+ $lang =~ s/_/-/g;
+
+ if( open D, "> $target_dir/$basename.$lang.lua" )
{
- printf "Generating %-40s ", "$target_dir/$basename.lua";
+ printf "Generating %-40s ", "$target_dir/$basename.$lang.lua";
my ( $k, $v );
}
else
{
- if( $k && defined($v) )
+ if( $k && defined($v) && length($v) > 0 )
{
$v =~ s/\\(['"\\])/$1/g;
$v =~ s/(['\\])/\\$1/g;
- printf D "%s%s='%s'\n", $v ? '' : '--', $k, $v;
+ printf D "%s='%s'\n", $k, $v;
+ $content++;
}
$k = $v = undef;
}
}
- print "done\n";
+ print $content ? "done ($content strings)\n" : "empty\n";
close D;
+
+
+ unlink("$target_dir/$basename.$lang.lua")
+ unless( $content > 0 );
}
close L;
build: luabuild gccbuild
-luabuild: i18n lua$(LUA_TARGET)
+luabuild: lua$(LUA_TARGET)
gccbuild: compile
compile:
clean: luaclean
-i18n:
- [ -n "$(XSLTPROC)" ] && for i in luasrc/i18n/*.xml; do [ "$$i" -nt "$${i%%[.]xml}.lua" ]\
- && $(XSLTPROC) $(MAKEPATH)i18n-lua-xhtml1.xsl $$i > $${i%%[.]xml}.lua; done || true
-
luasource:
mkdir -p dist$(LUA_MODULEDIR)
mkdir -p dist$(LUCI_MODULEDIR)
cp -pR lua/* dist$(LUA_MODULEDIR) 2>/dev/null || true
cp -pR htdocs/* dist$(HTDOCS) 2>/dev/null || true
for i in $$(find dist -name .svn -or -name .gitignore); do rm -rf $$i || true; done
- for i in dist$(LUCI_MODULEDIR)/i18n/*.xml; do [ -f "$$i" ] && rm $$i; done || true
+ ifneq ($(PO),)
+ for file in $(PO); do \
+ cp $(HOST)/lua-po/$$file.*.lua dist$(LUCI_MODULEDIR)/i18n/; \
+ done
+ endif
luastrip: luasource
+PO = default cbi admin-core sysauth wifi
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = default cbi admin-core sysauth wifi
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = default cbi admin-core sysauth wifi
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = default cbi admin-core sysauth wifi
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = default cbi admin-core sysauth wifi
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = default cbi admin-core sysauth wifi
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = default cbi admin-core sysauth wifi
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = default cbi admin-core sysauth wifi
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = uvl
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk
+PO = freifunk
+
include ../../build/config.mk
-include ../../build/module.mk
\ No newline at end of file
+include ../../build/module.mk