Streaming live at 10am (PST)

English & german: dual-language site


#1

Hello,

I'm in the process of providing a proposal for a two language site, English and German website. I've done a quick test where I'll create a folder for both EN and DE with all relevant pages etc. (Shared link below)

https://preview.webflow.com/preview/botamentwetrooms?preview=2d558d249a599166b5f18c6578d7d29f

As the domain name will be a .com and needs to point to a homepage. Is there any way this can be by-passed and depending on whether you are browsing from the UK or Germany it will land on the appropriate homepage for that language?

regards
David


#2

We don't have internationalization built in right now, but you could a little custom script to the <head> to redirect based on browser's language:

<script>
var language = navigator.language || navigator.browserLanguage;
if (language == 'en-US') {
  window.location = '/us/home';
}
<script>

#3

Paste this in Home > Page Settings > Header Code

<script>
var lang = navigator.language || navigator.browserLanguage;
if (lang.indexOf('de') >= 0) {
  location.replace('/de/home');
}
else {
  location.replace('/en/home');
}
</script>

Also, feel free to contact me for further code help and/or customization of third-party plugins


#4

Thanks Samuel, not exactly sure where to paste the script?


#5

Scroll down to "Individual Page Head Code".


#6

Yeah, I've done that. But it still lands on the splash page?


#7

Sorry, please replace the script again. There was a typo.

The script will redirect users based on their browser language.


#8

Hi Samuel, yeah that worked!


#9

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