Click to See Complete Forum and Search --> : getting user language preferences


Frankie
05-28-2003, 08:42 AM
Hi folks,
just have a question for u:

i need to check the user language preferences to redirect to the right language version. So i was trying to use the navigator object properties navigator.language (netscape) and navigator.browserLanguage (IE).
This way i'm able to check the browser language version but not the preferred languages listed in the browser language option. Surfing on altavista site i see it finds what is the language on top of my perferred languages list, both with netscape or IE, and this is just what i need. I have tried out all the navigator.laguage properties like systemLanguage userLanguage but i always get undefined or just the browser/os built in language.

any help will be very appreciated

Jona
05-28-2003, 09:41 AM
I would actually provide a link--like AltaVista provides with all of those pictures of native flags. And when you click on it, it translates the page--just make it instead go to a different page. That way, for the 12% or so of your visitors that have Javascript disabled, they will be able to go to their own choice of language.

Jona

Frankie
05-28-2003, 11:21 AM
well ok that's for the manual option for those that don't run javascript. but i need to do that automatically as dafault.
how can i read the user laguage array?

Jona
05-28-2003, 11:23 AM
You should probably look into doing this server side, then. Because I don't know of any other way...

Jona

Frankie
05-28-2003, 12:45 PM
How can i do that server side?? i mean u gotta read something setted in user browser. I was testing that wiht altavista:

suppose i add this languages in my IE or Netscape language option:

english
italian

i will be redirected to the english version.

if i invert the order with

italian
english

i'll be redirected to the italian version.

If u read the help section in the browser guide about that language table it says user should place his languages in his preferite order, 'cuz some site are available in multiple language versions. That means there should be some standard method to get this languages list or at least the language on the top.

khalidali63
05-28-2003, 12:56 PM
I am not sure if this is what you are looking for but let me know if you still have not found the solution.I'll post a solution to this....(possible soulution I should say *_*)

Frankie
05-28-2003, 04:52 PM
I still didn't get any help, so i'm really wondering about ur possible solution :) maybe it could be usefull.

let me know

Frankie
05-29-2003, 05:38 AM
Well ok i found the only way is to check env accept-language variable with server-side application. i will do that with php.

thank u all for ur help