projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix autodetection for extended language identifiers
[project/luci.git]
/
libs
/
web
/
luasrc
/
dispatcher.lua
diff --git
a/libs/web/luasrc/dispatcher.lua
b/libs/web/luasrc/dispatcher.lua
index
24ce246
..
5110209
100644
(file)
--- a/
libs/web/luasrc/dispatcher.lua
+++ b/
libs/web/luasrc/dispatcher.lua
@@
-134,7
+134,8
@@
function dispatch(request)
local lang = conf.main.lang
if lang == "auto" then
local aclang = http.getenv("HTTP_ACCEPT_LANGUAGE") or ""
local lang = conf.main.lang
if lang == "auto" then
local aclang = http.getenv("HTTP_ACCEPT_LANGUAGE") or ""
- for lpat in aclang:gmatch("[%w]+") do
+ for lpat in aclang:gmatch("[%w-]+") do
+ lpat = lpat and lpat:gsub("-", "_")
if conf.languages[lpat] then
lang = lpat
break
if conf.languages[lpat] then
lang = lpat
break