![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hey, i have a question. i'm about to run an multilangual (if that even is a word) site and i would like to adjust the language of the site depending on what region the user lives... is there a way to know? |
#3
| |||
| |||
|
|
i'm about to run an multilangual (if that even is a word) site and i would like to adjust the language of the site depending on what region the user lives... is there a way to know? |
#4
| |||
| |||
|
|
In comp.lang.javascript message <d70ff805-94df-4a01-8aeb-5cd0d884acbe@m7 3g2000hsh.googlegroups.com>, Fri, 6 Jun 2008 11:05:21, microgolf microg... (AT) gmail (DOT) com> posted: i'm about to run an multilangual (if that even is a word) site and i would like to adjust the language of the site depending on what region the user lives... is there a way to know? The place where the user is, the place where the user lives, and the place where the user comes from, and the places where the user's preferred language originated or is common, are not necessarily the same. *And the computer is not necessarily set to the local language. Consider a hypothetical Ambassador to Poland who was born in Korea and is visiting the residence of the French Ambassador to Bulgaria, and who wants to read about a baseball game. To find what language the user wants, ask the user, as Wikipedia does. -- *(c) John Stockton, nr London, UK. ?... (AT) merlyn (DOT) demon.co.uk *Turnpike v6.05 *MIME. *Web *<URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. *Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036) *Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036) |
#5
| |||
| |||
|
|
On Jun 6, 5:44 pm, Dr J R Stockton <j... (AT) merlyn (DOT) demon.co.uk> wrote: In comp.lang.javascript message <d70ff805-94df-4a01-8aeb-5cd0d884acbe@m7 3g2000hsh.googlegroups.com>, Fri, 6 Jun 2008 11:05:21, microgolf microg... (AT) gmail (DOT) com> posted: i'm about to run an multilangual (if that even is a word) site and i would like to adjust the language of the site depending on what region the user lives... is there a way to know? The place where the user is, the place where the user lives, and the place where the user comes from, and the places where the user's preferred language originated or is common, are not necessarily the same. And the computer is not necessarily set to the local language. Consider a hypothetical Ambassador to Poland who was born in Korea and is visiting the residence of the French Ambassador to Bulgaria, and who wants to read about a baseball game. To find what language the user wants, ask the user, as Wikipedia does. -- (c) John Stockton, nr London, UK. ?... (AT) merlyn (DOT) demon.co.uk Turnpike v6.05 MIME. Web <URL:http://www.merlyn.demon.co.uk/> - FAQish topics, acronyms, & links. Proper <= 4-line sig. separator as above, a line exactly "-- " (SonOfRFC1036) Do not Mail News to me. Before a reply, quote with ">" or "> " (SonOfRFC1036) You may also try using something like: var lang = navigator['language'] || navigator['userLanguage']; And then use that to help you determine. For example mine returns en- us (or en-Us or en-US, depending on the browser). Of course the best way is to ask. |
#6
| |||
| |||
|
|
There are ways to determine the user's location (with more or less precision) based on his IP address. |
#7
| |||
| |||
|
|
Hey, i have a question. i'm about to run an multilangual (if that even is a word) site and i would like to adjust the language of the site depending on what region the user lives... is there a way to know? |
#8
| ||||
| ||||
|
|
On Jun 6, 5:44 pm, Dr J R Stockton <j... (AT) merlyn (DOT) demon.co.uk> wrote: microgolf posted: i'm about to run an multilangual (if that even is a word) site and i would like to adjust the language of the site depending on what region the user lives... is there a way to know? The place where the user is, the place where the user lives, and the place where the user comes from, and the places where the user's preferred language originated or is common, are not necessarily the same. And the computer is not necessarily set to the local language. Consider a hypothetical Ambassador to Poland who was born in Korea and is visiting the residence of the French Ambassador to Bulgaria, and who wants to read about a baseball game. To find what language the user wants, ask the user, as Wikipedia does. [...] You may also try using something like: var lang = navigator['language'] || navigator['userLanguage']; |
|
And then use that to help you determine. |
|
For example mine returns en-us (or en-Us or en-US, depending on the browser). |
|
Of course the best way is to ask. |
![]() |
| Thread Tools | |
| Display Modes | |
| |