projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
77b05af
)
Added more reliable Lua2XML Converter for translations
author
Steven Barth
<steven@midlink.org>
Mon, 1 Sep 2008 19:23:56 +0000
(19:23 +0000)
committer
Steven Barth
<steven@midlink.org>
Mon, 1 Sep 2008 19:23:56 +0000
(19:23 +0000)
build/i18n-lua2xml.lua
[new file with mode: 0755]
patch
|
blob
diff --git a/build/i18n-lua2xml.lua
b/build/i18n-lua2xml.lua
new file mode 100755
(executable)
index 0000000..
040edfb
--- /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>'
+