Language detection JS Code

Hello everyone,

Any JS expert to help me here? I need to achieve the below in my multilingual website.

  • Make sure that the webpage detects the user’s browser language and display the content accordingly.
  • If the user has selected his favorite language on the page, this information will be stored.

Thanks in advance!

Any reply on this please?

Yes I build these, are you needing help?

One of the things you’ll need to consider is that browser list a series of languages and preference scores, so you need to resolve that to the languages you’re supporting. e.g. if they’re en-GB you might have en-GB or you might fall back to en as your default.

For a full multilingual solution though the trickier part is tagging and managing your content. For sites which need a simple multilingual capability with only 2 or 3 languages, this can be done directly in your content strings and by using custom attributes for tagging.

For anything more complex, you’ll probably want to look at Linguana or Weglot.

1 Like

Hello Muchael,

Thanks for the reply. This website would have 3 languages and am planning to do the multilingual in webflow itself. Can you please guide me on how this JS code would be?

Yes I can build a multilingual feature for you if you want but it’s a bit of work, you can direct message me if you’re needing that. I suppose it’s a good approach, it would cost you a bit up front but a lot less than the ongoing fees of a multilingual platform.

You might also check this library I built as a solution about 5 years ago, it has the capabilities you’re looking for but the documentation is thin.

The discussion thread was here-