X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=modules%2Fluci-base%2Fluasrc%2Fdispatcher.lua;h=0876ce658580cf2848f419dd3411638b3f59aaa7;hb=11f23559e4be78f202aa55d811d5b58cb0ca0a78;hp=c7903e6384e7a2f07f2952d352fddbf02aee9f25;hpb=8f409a45abb8cc4fda068c6a24085c467f3e37d8;p=project%2Fluci.git diff --git a/modules/luci-base/luasrc/dispatcher.lua b/modules/luci-base/luasrc/dispatcher.lua index c7903e638..0876ce658 100644 --- a/modules/luci-base/luasrc/dispatcher.lua +++ b/modules/luci-base/luasrc/dispatcher.lua @@ -197,6 +197,7 @@ function dispatch(request) assert(conf.main, "/etc/config/luci seems to be corrupt, unable to find section 'main'") + local i18n = require "luci.i18n" local lang = conf.main.lang or "auto" if lang == "auto" then local aclang = http.getenv("HTTP_ACCEPT_LANGUAGE") or "" @@ -208,7 +209,10 @@ function dispatch(request) end end end - require "luci.i18n".setlanguage(lang) + if lang == "auto" then + lang = i18n.default + end + i18n.setlanguage(lang) local c = ctx.tree local stat