summaryrefslogtreecommitdiffhomepage
path: root/build
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-09-01 19:23:56 +0000
committerSteven Barth <steven@midlink.org>2008-09-01 19:23:56 +0000
commit95006a1f116347f0ad349bbd52bc18732fb55b12 (patch)
tree896de9a72606a68e8528761d8d904b3ab9e06362 /build
parent77b05af325beca587040e1a429e2ad20d2849b7a (diff)
Added more reliable Lua2XML Converter for translations
Diffstat (limited to 'build')
-rwxr-xr-xbuild/i18n-lua2xml.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/build/i18n-lua2xml.lua b/build/i18n-lua2xml.lua
new file mode 100755
index 000000000..040edfbd8
--- /dev/null
+++ b/build/i18n-lua2xml.lua
@@ -0,0 +1,20 @@
+#!/usr/bin/lua
+local util = require "luci.util"
+
+local x = {}
+local f = loadfile(arg[1])
+setfenv(f, x)
+f()
+
+print '<?xml version="1.0" encoding="utf-8"?>'
+print ''
+print '<i18n:msgs xmlns:i18n="http://luci.freifunk-halle.net/2008/i18n#" xmlns="http://www.w3.org/1999/xhtml">'
+print ''
+
+for k, v in util.kspairs(x) do
+ print ('<i18n:msg xml:id="%s">%s</i18n:msg>' % {k, util.pcdata(v)})
+end
+
+print ''
+print '</i18n:msgs>'
+