Streaming live at 10am (PST)

Detect Browser Language and Redirect


Hello @Webflow Community,

Do anyone have a simple JS code that I can imbed in my CustomCode, so that:
When the visitor comes to the website,
- If Browser Language = English, then do nothing (stay on the
- If Browser Language = French, then redirect to /french (

Any JS wisdom guru ?

Help much much appreciated !!!

<script type="text/javascript">
    $( document ).ready(function(){
        var userLang = navigator.language || navigator.userLanguage;
        if (userLang == "en") {
        else {
            window.location.href = ""

This should work for you.Replace google with your own domain.


Hello @steelesong,

This looks great,
I'm definitely saving this code for further needs.

Thank you so much for your time and help !!


Your quite welcome sir. Wrote this in college I've always referred to it for sites that need language support.


You could as well have used localise.js.


Thanks @topelovely

I've finally used and it's working like a charm !


Hi @steelesong this works for 2 languages one of which is english.
In my case, I've built a 3 languages site (en, es and ca). Could you please update your answer for this case?

Besides this, I'd like to confirm that Localize.js is a tool that automatically translates your english site to other languages, am I right? But the translation is quite... impersonal, I'm afraid. Thanks for your comments on this as well.

$( document ).ready(function(){
    var userLang = navigator.language || navigator.userLanguage;
    if (userLang == "en") {
    else if(userLang == ''es"){
       window.location.href = ""
    else if(userLang == ''ca"){
       window.location.href = ""
    else {
        window.location.href = ""

This should work.
PLEASE NOTE - its showing inconsistent quotations around es and ca. Dont copy and paste this. I dont know why the forums arent showing the correct single or double quotation..

Language Detection and Redirect URL

Hey @steelesong & @jcawoopa!

Have you tried Localize yet? We handle all of this on your behalf, no coding required. Here's our setup guide for Webflow =>

We make it really easy to translate your Webflow site. Here's why:

-- User-friendly editor to translate or review content.
-- Add collaborators to help with the project
-- Get real-time quotes from professional translation instantly. Place orders in a click.
-- Quick Import/Export of content
-- Automatic translation of all updates and changes.

Easy setup -- be done in minutes.
Great support -- quick response time.
All Languages -- even the rare ones!
Free trial -- zero risk.
Low cost -- affordable for any budget.

Reach out to our support team anytime. We're happy to help guide you through setup! =>

closed #10