Skip to content
Snippets Groups Projects
Commit 2e2c1c3b authored by gambas's avatar gambas
Browse files

Try to enhance language detection in Request.Language property.

[GB.WEB]
* NEW: Try to enhance language detection in Request.Language property.
parent e3eb2388
No related branches found
No related tags found
No related merge requests found
Pipeline #68631979 failed
......@@ -233,6 +233,9 @@ Private Function Language_Read() As String
Dim sLang As String
Dim iPos As Integer
Dim I As Integer
Dim sFirst As String
'fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
aLang = Split(CGI["HTTP_ACCEPT_LANGUAGE"], ",")
......@@ -240,8 +243,11 @@ Private Function Language_Read() As String
iPos = InStr(sLang, ";")
If iPos Then sLang = Left(sLang, iPos - 1)
If InStr(sLang, "-") Then Return Replace(sLang, "-", "_") & ".UTF-8"
If Not sFirst Then sFirst = sLang
Next
If sFirst Then Return sFirst & ".UTF-8"
Return System.Language
End
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment