Language detection for iPhone - Can anyone teach me how to detection iPhone browser language using javascript via html?
I am working on a multi-language website with 18 languages. My language browser-language based detection script works fine on PC but not mobile devices. Can anyone help?
<!--//
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.indexOf('en') > -1) document.location.href = 'en/index.php';
else if (language.indexOf('zh-TW') > -1) document.location.href = 'zh/index.php';
else if (language.indexOf('zh-Hant') > -1) document.location.href = 'zh/index.php';
else if (language.indexOf('zh-CN') > -1) document.location.href = 'zh_CN/index.php';
else if (language.indexOf('zh-Hans') > -1) document.location.href = 'zh_CN/index.php';
else document.location.href = 'en/index.php';
// End -->
iPhone 4