nichalp
09-27-2004, 02:16 PM
I'm trying to make my page with both US and British english. So this is what I have done.
eg <span lang="en-us" class="ame">color</span><span lang="en-gb" class="bri">colour</span>.
Now I want to use javascript to detect the user language chosen preference so that the following can be achieved.
if lang=us then .bri {display:none} elso .ame {display:none}
I learnt that the javascript syntax should be:
"navigator.userLanguage"
However when I tried to use the navigator.userLanguage on IE, it refused to work showing me only british spellings, even though I shuffled my language preference from en-gb to en-us on IE, and tried to do he same with other languages.
Please advise.
eg <span lang="en-us" class="ame">color</span><span lang="en-gb" class="bri">colour</span>.
Now I want to use javascript to detect the user language chosen preference so that the following can be achieved.
if lang=us then .bri {display:none} elso .ame {display:none}
I learnt that the javascript syntax should be:
"navigator.userLanguage"
However when I tried to use the navigator.userLanguage on IE, it refused to work showing me only british spellings, even though I shuffled my language preference from en-gb to en-us on IE, and tried to do he same with other languages.
Please advise.