Priority order
The widget resolves the active language using the following order, from highest to lowest priority:lang URL parameter
If the page URL contains a This overrides all other settings, making it ideal for sharing language-specific links or deep-linking to translated pages.
lang query parameter with a supported language code, the widget uses it immediately.User's saved preference
If no URL parameter is present, the widget checks
localStorage for a previously saved preference under the key jss-pref. This is set automatically whenever a user selects a language from the widget dropdown.Auto-detecting browser language
SetautoDetectLanguage: true to have the widget read the user’s browser language (navigator.language) and automatically translate the page on load if the detected language differs from pageLanguage.
autoDetectLanguage is enabled and no URL parameter or localStorage preference is found, the widget uses the browser language as the initial language instead of falling back to pageLanguage.
When
autoDetectLanguage is false (the default), the widget skips browser language detection entirely. It reads the URL parameter first, then localStorage, then falls back to pageLanguage.localStorage key
The widget stores the user’s selected language inlocalStorage under the key jss-pref. This persists between sessions so returning users see the site in their preferred language without re-selecting it.
You can read or clear this key directly if you need to reset a user’s language preference programmatically: