* luci/build: add uvl2i18n helper script
This commit is contained in:
parent
3ab941a8e7
commit
935d29415e
1 changed files with 33 additions and 0 deletions
33
build/uvl2i18n.lua
Executable file
33
build/uvl2i18n.lua
Executable file
|
@ -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
|
Loading…
Reference in a new issue