Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
Automatic Language Detection for Multilingual LWR Sites
Let’s say your LWR site has English as the default language, but it also has a French version. When guest users access the site, they see the site in their browser’s default language. When authenticated users access the site, they see the language that’s set in their user profile.
Keep these considerations in mind when using automatic language detection.
- Automatic language detection is on by default in your org. To disable it, contact Salesforce Customer Support.
- If the PreferredLanguage cookie is set for a site, the language only changes when the user changes it with the language selector, or the cookie is deleted for the site. Otherwise, the site continues to use the language specified in the cookie, even if it doedsn't match the current user's default language setting.
- If the site doesn’t support the user profile language or the browser’s default language, users see the default site language instead.
- If your org uses Identity Provider (IdP) initiated SSO login from one site to a different site, Automatic Language Detection doesn't work.
- If guest or authenticated users change their language preference via the Language Selector component, the new preference is used the next time they access the site.
- Automatic language detection only happens when a user accesses the site without the locale path prefix. For example, a user accessing www.salesforce.com/siteprefix/ is automatically redirected, but www.salesforce.com/siteprefix/fr/ goes to the French language site.
- When a user logs in to the site, the cookie locale is set immediately. Changing the user locale doesn’t change their language preference, even if the user never used the Language Selector to change the language.
- Automatic language detection relies on a functional cookie. If functional cookies are disabled, your site can't detect or save the language preference of your user.
- Language preferences are prioritized as follows:
- Locale path prefix
- Cookie locale
- User Profile’s set locale
- Browser locale