var userLang navigator language navigator userLanguage navigator brows

1
2
3
4
5
6
7
8
9
var userLang = navigator.language || navigator.userLanguage || navigator.browserLanguage;
if (/en|us|uk|ca/i.test(userLang)) {
if (confirm("Looks like you're using an english locale, would you like to switch to you'r native lang
version of this site?")) {
alert ("Switching to english version of the site");
window.location.href = "http://en.delonablago.ru";
}
else alert("Вы останетесь на русскоязычной версии.");
};