Magnolia 5.6 reached end of life on June 25, 2020. This branch is no longer supported, see End-of-life policy.
...
The setting of a site locale influences the editorial content and template labels and unless a public user registers to a web product/service and actively provides the locale information to the webapp, the webserver has to rely on other means that could help identify the visitors preferred locale.
...
There are a number of ways of obtaining some form of locale information. Some of them use advanced techniques such as geolocation based on ping delay or topology, but one of the most common way is to look into the content of a HTTP request. At least the following three parts of an HTTP request are relevant to the identification of the public user's locale:
User-Agent
headerAccept-Language
headerRequest-URI
While it may occassionally contain some locale informationcontaining information such as en_US
, for example the en_US
part in
Code Block |
---|
Mozilla/5.0 (compatible; Konqueror/4.5; NetBSD 5.0.2; X11; amd64; en_US) KHTML/4.5.4 (like Gecko) |
the this locale information in the User-Agent
header is
and more often than not will be even is missing:
Code Block |
---|
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36 |
...
Magnolia has no direct means how to check for the existence of and retrieve this type of locale information. The preferred locale information is communicated via the Accept-Language
header.
...