Page 1 of 1

Language

Posted: Fri Dec 24, 2004 7:48 am
by coco
Redirects a user to the page based on their language. For example, English language user browsers, which report the language as EN in most cases can be redirected to an English page, while Spanish language user browsers, which report the language as ES it most cases can be sent to a separate Spanish page.



<!-- ONE STEP TO INSTALL LANGUAGE:

1. Copy the coding into the HEAD of your HTML **** and modify to suit -->



<head>

<script type="text/javascript" language="JavaScript1.2">
<!-- Begin
if (navigator.appName == 'Netscape')
var language = navigator.language;
else
var language = navigator.browserLanguage;

// Modify the .html pages, can be either file.html or, http://www.domain

if (language.indexOf('en') > -1) ****.location.href = 'English.html';
else if (language.indexOf('nl') > -1) ****.location.href = 'dutch.html';
else if (language.indexOf('fr') > -1) ****.location.href = 'french.html';
else if (language.indexOf('de') > -1) ****.location.href = 'german.html';
else if (language.indexOf('ja') > -1) ****.location.href = 'japanese.html';
else if (language.indexOf('it') > -1) ****.location.href = 'italian.html';
else if (language.indexOf('pt') > -1) ****.location.href = 'portuguese.html';
else if (language.indexOf('es') > -1) ****.location.href = 'Spanish.html';
else if (language.indexOf('sv') > -1) ****.location.href = 'swedish.html';
else if (language.indexOf('zh') > -1) ****.location.href = 'chinese.html';
else
****.location.href = 'English.html';
// End -->
</script>

</head>

Posted: Sat Mar 11, 2006 9:53 am
by kaos_frack
navigator.appName == 'Netscape'
this code is not suitable
cos in some browsers there is an option like:
Identify As: [Internet Explorer] [Netscape] [Mozilla] [Opera]

Posted: Fri Apr 28, 2006 5:06 pm
by Kaky
Can it be done by ip if ip from one country the server redirects to that part of site if another country another site ????

Posted: Mon Jun 05, 2006 6:05 am
by uz
yeah
what about uzbek language can we make it ourselves?