Commit from LuCI Translation Portal by user jow.: 137 of 175 messages translated...
[project/luci.git] / build / cbi2uvl.lua
index 10d9567..7fe8ef5 100755 (executable)
@@ -23,14 +23,21 @@ if not arg[1] then
        os.exit(1)
 end
 
-i18n.load("default", "en")
-i18n.load("admin-core", "en")
-i18n.load("wifi", "en")
+i18n.load("base", "en")
 
 if arg[2] then
        i18n.load(arg[2], "en")
 end
 
+if arg[3] then
+       pcall(function()
+               require "uci"
+               require "luci.model.uci".cursor = function(config, save)
+                       return uci.cursor(config or arg[3] .. "/etc/config", save or arg[3] .. "/tmp/.uci")
+               end
+       end)
+end
+
 local map = cbi.load(arg[1])[1]
 assert(map)
 
@@ -45,7 +52,7 @@ if #map.description > 0 then
        print ("        option description '%s'" % util.striptags(map.description))
 end
 
-for i, sec in pairs(map.children) do if util.instanceof(sec, cbi.TypedSection) then
+for i, sec in pairs(map.children) do if util.instanceof(sec, cbi.AbstractSection) then
        print ("\nconfig section")
        print ("        option name '%s'" % sec.sectiontype)
        print ("        option package '%s'" % map.config)