• R/O
  • HTTP
  • SSH
  • HTTPS

luci: Commit

LuCI - OpenWrt Configuration Interface


Commit MetaInfo

Revisão6d69f4080dd81fc163ffb459e6df5a600a10530a (tree)
Hora2022-01-26 17:17:08
Autor练亮斌 <1129525450@qq.c...>
CommiterTianling Shen

Mensagem de Log

luci-base: fix language auto detection

Chrome send http header "Accept-Language: zh-CN,zh;q=0.9,en;q=0.8",
we only have "zh_cn" language, that would not match,
we should try lowercase.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>

Mudança Sumário

Diff

--- a/modules/luci-base/luasrc/dispatcher.lua
+++ b/modules/luci-base/luasrc/dispatcher.lua
@@ -225,6 +225,11 @@ function dispatch(request)
225225 lang = lpat
226226 break
227227 end
228+ lpat = lpat and lpat:lower()
229+ if conf.languages[lpat] then
230+ lang = lpat
231+ break
232+ end
228233 end
229234 end
230235 if lang == "auto" then
Show on old repository browser