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
brryant
(Bryant Chou)
November 16, 2016, 5:58pm
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>
samliew
(webflowexpert.com)
November 17, 2016, 7:43am
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
2 Likes
Thanks Samuel, not exactly sure where to paste the script?
samliew
(webflowexpert.com)
November 17, 2016, 9:33am
5
Scroll down to “Individual Page Head Code”.
Yeah, I’ve done that. But it still lands on the splash page?
samliew
(webflowexpert.com)
November 18, 2016, 3:18am
7
Sorry, please replace the script again. There was a typo.
The script will redirect users based on their browser language.
Hi Samuel, yeah that worked!
system
(system)
Closed
January 16, 2017, 1:34pm
9
This topic was automatically closed after 60 days. New replies are no longer allowed.