projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
1d56267
)
Merge pull request #659 from NeoRaider/default-language
author
Jo-Philipp Wich
<jow@openwrt.org>
Tue, 1 Mar 2016 16:54:49 +0000
(17:54 +0100)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Tue, 1 Mar 2016 16:54:49 +0000
(17:54 +0100)
modules/base: dispatcher: use default language if automatic choice fails
modules/luci-base/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/modules/luci-base/luasrc/dispatcher.lua
b/modules/luci-base/luasrc/dispatcher.lua
index
c7903e6
..
0876ce6
100644
(file)
--- 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