I have a french and an english version of my website:
*example.com/ is my english version.
*example.com/fr/ is my french version.
So they have the possibility to change the websites version by clicking on a flag,but by default if they arrive on example.com it will be in english.
I would like to give them the version corresponding to their language preference, i detect language preference with :
var language = window.navigator.userLanguage || window.navigator.language;
But then what code do i use so that when they arrive on the webpage, it will give the version according to the user language preference ?
And if the website gives a french version but the user wants english version, still has the possiblity to change manualy.