Enhance language detection done by the Request.Language property.
[GB.WEB] * NEW: Enhance language detection done by the Request.Language property.
This commit is contained in:
parent
64a13bfab4
commit
0179eb5936
1 changed files with 9 additions and 6 deletions
|
@ -232,14 +232,17 @@ Private Function Language_Read() As String
|
|||
Dim aLang As String[]
|
||||
Dim sLang As String
|
||||
Dim iPos As Integer
|
||||
Dim I As Integer
|
||||
|
||||
aLang = Split(CGI["HTTP_ACCEPT_LANGUAGE"], ",")
|
||||
If aLang.Count = 0 Then Return System.Language
|
||||
sLang = aLang[0]
|
||||
iPos = InStr(sLang, ";")
|
||||
If iPos Then sLang = Left(sLang, iPos - 1)
|
||||
sLang = Replace(sLang, "-", "_")
|
||||
Return sLang & ".UTF-8"
|
||||
|
||||
For I = 0 To aLang.Max
|
||||
iPos = InStr(sLang, ";")
|
||||
If iPos Then sLang = Left(sLang, iPos - 1)
|
||||
If InStr(sLang, "-") Then Return Replace(sLang, "-", "_") & ".UTF-8"
|
||||
Next
|
||||
|
||||
Return System.Language
|
||||
|
||||
End
|
||||
|
||||
|
|
Loading…
Reference in a new issue