diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-25 11:54:49 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-09-25 11:54:49 +0000 |
commit | 935d29415e8514cf588923f6019334b2ab869783 (patch) | |
tree | fcea6dac15442e34983f605938aef050b7611fcc /build | |
parent | 3ab941a8e7a6cd1d51464a45ad36f0d0a6fc5112 (diff) |
* luci/build: add uvl2i18n helper script
Diffstat (limited to 'build')
-rwxr-xr-x | build/uvl2i18n.lua | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/build/uvl2i18n.lua b/build/uvl2i18n.lua new file mode 100755 index 000000000..771b26dd7 --- /dev/null +++ b/build/uvl2i18n.lua @@ -0,0 +1,33 @@ +#!/usr/bin/lua +-- uvl2i18n.lua - Convert uvl schemes to i18n files +-- $Id$ + +require("luci.util") +require("luci.uvl") + +local shm = luci.uvl.UVL():get_scheme(arg[1]) + +for s, o in luci.util.kspairs(shm.sections) do + print( string.format( '%s_%s = %q', shm.name, s:gsub("_",""), o.title ) ) + + if o.description and #o.description > 0 then + print( string.format( + '%s_%s_desc = %q', shm.name, s:gsub("_",""), o.description + ) ) + end + + for v, o in luci.util.kspairs(shm.variables[s]) do + print( string.format( + '%s_%s_%s = %q', shm.name, s:gsub("_",""), v:gsub("_",""), o.title + ) ) + + if o.description and #o.description > 0 then + print( string.format( + '%s_%s_%s_desc = %q', shm.name, s:gsub("_",""), + v:gsub("_",""), o.description + ) ) + end + end + + print() +end |