Streaming live at 10am (PST)

Detect language and Redirect BUT stop redirecting if user Manually select a language

Hello @Everyone,

I have 2 pages, the homepage ( and the translated page (

I’ve put this following javascript on the homepage (in the Custom Code of this page only):

 var userLang = navigator.language || navigator.userLanguage;
 if(userLang != "fr" || userLang != "fr-FR"){

If the user is French, he’ll be redirected to

But let’s say this user clicks on a language dropdown somewhere on the site, that lets him choose English or French, and clicks on English, because he wants to see the original english version of the site.

The issue is, the script on the English page will run again, and will redirect him back to the page.
And he’ll never be able to see the original english version.

So the question is, how do I tell the browser “Okay this user finally wants to go to the original, stop running the script” ?

As we can’t use Cookies on Webflow, then I’d guess I need something to tell the script to run just once (but again, how would the script know as the user switched page and came back?)

Or maybe there is a trick I can put on the dropdown English / French links in Custom Attribute?

Any help very much appreciated!

You can almost do everything with custom code.

Great. So now what would be the said custom code (with this js-cookie script) ?

I’m not fluent in JS yet…

This topic was automatically closed after 60 days. New replies are no longer allowed.