Details
-
Bug
-
Resolution: Solved By
-
Major
-
None
-
5.4.1
-
Unknown
-
Description
Currently, if the browser provides in its accepted-languages header something like pt-BR, the language set in the context (and the cookie) is pt. This is definitely wrong, since we support pt_BR and pt translations separately.
If we simply fix the browser detection to report fr_FR, and the supported language only contains en,fr with a default to en, we will need to also take care of falling back to fr. Currently, the browser detected language is only forced to be a supported language if xwiki.language.forceSupported' is configured to 1 (the default being 0), and obviously does not take care of these countries subtleties.
Apart from com.xpn.xwiki.XWiki#getLanguagePreference(), com.xpn.xwiki.XWiki#getDocLanguagePreferenceNew() and com.xpn.xwiki.XWiki#getInterfaceLanguagePreference() use their own parsing that does not support the country either.
Attachments
Issue Links
- is duplicated by
-
XWIKI-12728 The country code specified in the Accept-Language HTTP header is ignored when computing the current locale
- Closed