From 9835296ba2623b5c87624da3a8ba5f43595297d0 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 4 Apr 2009 22:54:16 +0000 Subject: trunk: prepare LuCI to handle .lua.gz files --- modules/admin-full/luasrc/model/cbi/admin_index/luci.lua | 6 +++++- modules/admin-mini/luasrc/model/cbi/mini/luci.lua | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/admin-full/luasrc/model/cbi/admin_index/luci.lua b/modules/admin-full/luasrc/model/cbi/admin_index/luci.lua index 20d50cceb..6ec13b84e 100644 --- a/modules/admin-full/luasrc/model/cbi/admin_index/luci.lua +++ b/modules/admin-full/luasrc/model/cbi/admin_index/luci.lua @@ -29,7 +29,11 @@ l:value("auto") local i18ndir = luci.i18n.i18ndir .. "default." for k, v in pairs(luci.config.languages) do - if k:sub(1, 1) ~= "." and luci.fs.access(i18ndir .. k:gsub("_", "-") .. ".lua") then + local file = i18ndir .. k:gsub("_", "-") + if k:sub(1, 1) ~= "." and ( + luci.fs.access(file .. ".lua") or + luci.fs.access(file .. ".lua.gz") + ) then l:value(k, v) end end diff --git a/modules/admin-mini/luasrc/model/cbi/mini/luci.lua b/modules/admin-mini/luasrc/model/cbi/mini/luci.lua index 9eea8715e..d3afd5537 100644 --- a/modules/admin-mini/luasrc/model/cbi/mini/luci.lua +++ b/modules/admin-mini/luasrc/model/cbi/mini/luci.lua @@ -29,7 +29,11 @@ l:value("auto") local i18ndir = luci.i18n.i18ndir .. "default." for k, v in pairs(luci.config.languages) do - if k:sub(1, 1) ~= "." and luci.fs.access(i18ndir .. k:gsub("_", "-") .. ".lua") then + local file = i18ndir .. k:gsub("_", "-") + if k:sub(1, 1) ~= "." and ( + luci.fs.access(file .. ".lua") or + luci.fs.access(file .. ".lua.gz") + ) then l:value(k, v) end end -- cgit v1.2.3