diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-04-04 22:54:16 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-04-04 22:54:16 +0000 |
commit | 9835296ba2623b5c87624da3a8ba5f43595297d0 (patch) | |
tree | 71ab8933e418c25f4b283ff630d643154c168c21 /libs/web/luasrc/i18n.lua | |
parent | f3deef9ec570d49795346516d34c1b42fb416fde (diff) |
trunk: prepare LuCI to handle .lua.gz files
Diffstat (limited to 'libs/web/luasrc/i18n.lua')
-rw-r--r-- | libs/web/luasrc/i18n.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libs/web/luasrc/i18n.lua b/libs/web/luasrc/i18n.lua index 4b3adf7eb..4db9c3343 100644 --- a/libs/web/luasrc/i18n.lua +++ b/libs/web/luasrc/i18n.lua @@ -47,7 +47,9 @@ end function load(file, lang, force) lang = lang and lang:gsub("_", "-") or "" if force or not loaded[lang] or not loaded[lang][file] then - local f = loadfile(i18ndir .. file .. "." .. lang .. ".lua") + local f = loadfile(i18ndir .. file .. "." .. lang .. ".lua") or + loadfile(i18ndir .. file .. "." .. lang .. ".lua.gz") + if f then table[lang] = table[lang] or {} setfenv(f, table[lang]) |