Language

Any problem with javascript can be discussed here.
Locked
coco
Posts: 50
Joined: Thu Dec 23, 2004 12:01 pm
Contact:

Language

Post 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>


kaos_frack
Posts: 504
Joined: Sat May 07, 2005 8:03 am
Contact:

Post 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]
Kaky
Posts: 274
Joined: Tue Apr 18, 2006 7:43 pm

Post 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 ????
Image

A funny picture -------> me , myself and i (too much for this world)
uz
Posts: 140
Joined: Sat Dec 24, 2005 5:32 pm

Post by uz »

yeah
what about uzbek language can we make it ourselves?
Locked