* libs/web: Fixed translation handling

This commit is contained in:
Steven Barth 2008-07-06 15:19:26 +00:00
parent bcce358d8a
commit 8f770fd17a
2 changed files with 6 additions and 2 deletions

View file

@ -34,7 +34,7 @@ config event uci_oncommit
config internal languages
option de "Deutsch"
option en "English"
option fr "French"
option fr "Français"
config internal sauth
option sessionpath "/tmp/.lucisessions"

View file

@ -18,8 +18,12 @@ m = Map("luci", translate("webui"), translate("a_i_luci1",
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) ~= "." then
if k:sub(1, 1) ~= "."
and (luci.fs.isfile(i18ndir .. k .. ".lua")
or luci.fs.isfile(i18ndir .. k)) then
l:value(k, v)
end
end