meta data for this page
Calculation of the current language on a CMS site
SAP Hybris provides many methods to change the language of the site and there isn't any documentation on the topic. Based on some testing, the current available mechanisms and their priorities are:
- The user has set the language manually through:
- The language dropdown list on the website: This method has the highest priority, so it overrides the old language in every situation. Internally a request with the url */_s/language?code=de is sent to the server.
- A HTTP request with the parameter lang (?lang=de) is sent to the server. The SetLanguageBBeforeControllerHandler is responsible for changing the language.
- Language in the profile of current user: During the log in process a cookie with the language setting is created. The B2C Accelerator doesn't allow to change the language in the profile.
- Language of the browser, if the language is configured in the CMS site
- Default language of the CMS site: This is the mechanism with the less priority.
Other Hybris extensions use other mechanisms. For example, the Omni Connect webservices use the default language of the base store.
–Based on Hybris 5.3
Discussion