Public portal language based on custom URL without page refresh?

Weird
Mega Sage

As an example let's say we have two languages. English and French.
The French portal is accessed from french.firm.com/sp and the English one is english.firm.com/sp. These would be custom URLs for the same instance.

Now if a guest user accesses the French portal they should be automatically set to use French language and similarly English link should change language to English. Now I have a setup working based on the OOB language picker but as I need to check the URL on client side there's an unfortunate refresh of the page happening and it's both annoying to the users and ugly to see.

Any ideas on what would be the best way to set the language before the page loads. I was considering trying to use sp.getParameter on server level, but I'd rather avoid using parameters as solution as people can access the pages without those. Perhaps someone has tackled a similar problem and solved it before?

5 REPLIES 5

I gave that a try and interestingly it does generate a message saying that content is shown in my preferred language, but it does not affect the language. Actually the message shows up on my current setup as well. Might have to figure out how to get rid of it so that it doesn't show to everyone.