Use luci.fs.access instead of luci.fs.isfile where applicable
[project/luci.git] / modules / admin-mini / luasrc / model / cbi / mini / luci.lua
index 1b0f3b1..819a9b6 100644 (file)
@@ -15,13 +15,20 @@ $Id$
 require("luci.config")
 m = Map("luci", translate("webui"), translate("a_i_luci1"))
 
+-- force reload of global luci config namespace to reflect the changes
+function m.commit_handler(self)
+       package.loaded["luci.config"] = nil
+       require("luci.config")
+end
+
+
 c = m:section(NamedSection, "main", "core", translate("general"))
 
 l = c:option(ListValue, "lang", translate("language"))
 
 local i18ndir = luci.i18n.i18ndir .. "default."
 for k, v in pairs(luci.config.languages) do
-       if k:sub(1, 1) ~= "." and luci.fs.isfile(i18ndir .. k .. ".lua") then
+       if k:sub(1, 1) ~= "." and luci.fs.access(i18ndir .. k:gsub("_", "-") .. ".lua") then
                l:value(k, v)
        end
 end
@@ -33,4 +40,4 @@ for k, v in pairs(luci.config.themes) do
        end
 end
 
-return m
\ No newline at end of file
+return m