What I want to achieve is loading my community page with the current browser or local selected language.

So far I have different page variations for each language, so I want to load the language corresponding to the browser/local language or (if there is not translated language for the current browser language) load a default language. All this without having to redirect the user once the page has already load with the default language.

Is there a way to achieve this?



I have used custom labels while using sites. To determine the browser language you can use Accept-Language.

language = ApexPages.currentPage().getHeaders().get('Accept-Language').substring(0,2);
  • Thanks for your answer, but I think that does not work for Lighning Communities, do you know a way to do it with Communitites? – Ismael Slimane Jun 1 '18 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.