projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e7234be
)
Fix autodetection for extended language identifiers
author
Steven Barth
<steven@midlink.org>
Fri, 30 Jan 2009 15:29:53 +0000
(15:29 +0000)
committer
Steven Barth
<steven@midlink.org>
Fri, 30 Jan 2009 15:29:53 +0000
(15:29 +0000)
libs/web/luasrc/dispatcher.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/dispatcher.lua
b/libs/web/luasrc/dispatcher.lua
index 24ce246dfcfe9dab75f7a24b628dac512c263101..5110209aacb21e0ab6781d61b49b016ebe7bce1e 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 ""
- 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