* luci/build: fix crash in uvl2i18n.lua when variable or section has no title
This commit is contained in:
parent
3ddce490db
commit
c4d59e0fe5
1 changed files with 2 additions and 2 deletions
|
@ -8,7 +8,7 @@ require("luci.uvl")
|
||||||
local shm = luci.uvl.UVL():get_scheme(arg[1])
|
local shm = luci.uvl.UVL():get_scheme(arg[1])
|
||||||
|
|
||||||
for s, o in luci.util.kspairs(shm.sections) do
|
for s, o in luci.util.kspairs(shm.sections) do
|
||||||
print( string.format( '%s_%s = %q', shm.name, s:gsub("_",""), o.title ) )
|
print( string.format( '%s_%s = %q', shm.name, s:gsub("_",""), o.title or s ) )
|
||||||
|
|
||||||
if o.description and #o.description > 0 then
|
if o.description and #o.description > 0 then
|
||||||
print( string.format(
|
print( string.format(
|
||||||
|
@ -18,7 +18,7 @@ for s, o in luci.util.kspairs(shm.sections) do
|
||||||
|
|
||||||
for v, o in luci.util.kspairs(shm.variables[s]) do
|
for v, o in luci.util.kspairs(shm.variables[s]) do
|
||||||
print( string.format(
|
print( string.format(
|
||||||
'%s_%s_%s = %q', shm.name, s:gsub("_",""), v:gsub("_",""), o.title
|
'%s_%s_%s = %q', shm.name, s:gsub("_",""), v:gsub("_",""), o.title or v
|
||||||
) )
|
) )
|
||||||
|
|
||||||
if o.description and #o.description > 0 then
|
if o.description and #o.description > 0 then
|
||||||
|
|
Loading…
Reference in a new issue