M
mouton
Hello,
I am a beginner. My website has 2 pages: one in English and one in
French. I would like non English people to be directed to the English
page. There I would like to display a particular sentence in 1 of 3
languages depending on the language of the visitor (this sentence would
be in Spanish or Italian or German and the rest of the page in English).
I have found this code to detect the language:
<SCRIPT language="javascript">
<!--
function getlanguage(){
language=navigator.language;
if(language)
{language=language.substring(0,2);}
}
switch (language){
case "en" :
window.location="english.htm";
break;
case "fr" :
window.location="french.htm";
break;
default :
window.location="english.htm";
}
}
// -->
</SCRIPT>
But then I do not know if this code is standards compliant and what to
do in the English page to display the sentence in one of the 3 languages...
Can you please help me.
Thank you.
I am a beginner. My website has 2 pages: one in English and one in
French. I would like non English people to be directed to the English
page. There I would like to display a particular sentence in 1 of 3
languages depending on the language of the visitor (this sentence would
be in Spanish or Italian or German and the rest of the page in English).
I have found this code to detect the language:
<SCRIPT language="javascript">
<!--
function getlanguage(){
language=navigator.language;
if(language)
{language=language.substring(0,2);}
}
switch (language){
case "en" :
window.location="english.htm";
break;
case "fr" :
window.location="french.htm";
break;
default :
window.location="english.htm";
}
}
// -->
</SCRIPT>
But then I do not know if this code is standards compliant and what to
do in the English page to display the sentence in one of the 3 languages...
Can you please help me.
Thank you.