Author |
Topic |
|
bjlt
Senior Member
1144 Posts |
Posted - 19 September 2002 : 13:27:12
|
this is a function to detect the language you provide which is also on top of the user's preference, you don't need to have them all if you do not support all of them, just add the one you support there in the function. if the language has quite some variants, put it it the first Case else, otherwise put it as one of the first cases.
this is default to English, (the last case else), change it to your own if needed.
this only takes consideration of different writting format of Chinese, if your language also have more than one ways to write, you need to fix it yourself.
you can also name the result whatever you like.
then you can use the result to do the redirection or customising.
Happy internationalization.
new code below< |
Edited by - bjlt on 01 October 2002 12:31:00 |
|
Deleted
deleted
4116 Posts |
Posted - 19 September 2002 : 14:47:21
|
I was planning to use a similar functionality (see here: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q208935 ).
The problem that I didn't include it till now is, that the browser-language is not the same as the LCID values we use - there is no 1-1 match...
Do you have a complete list of all possible HTTP_ACCEPT_LANGUAGE values? < |
Stop the WAR! |
|
|
bjlt
Senior Member
1144 Posts |
Posted - 19 September 2002 : 15:01:06
|
I found the values in the ie laguage settings.
tools-options-first tab-languages.
I don't know if it's a complete list. Frankly speaking I'm quite confused by all the LCID, codepage, encoding and database language sort things. < |
|
|
Deleted
deleted
4116 Posts |
Posted - 19 September 2002 : 16:36:02
|
I know this, but I'm using IE v5.5sp2+, so I thought perhaps there is a more complete list with XP & IE6. Couldn't find it on MS site at that time.
For us here, there will be different levels of "default" locale/language:
- system default set by admin
=> needed for first visit (I was thinking about the HTTP functionality here)
- user preference in profile
=> needed for sending e-mails etc
- users last selected (from selector, i.e. from cookie)
=> so it is rendered with correct locale anytime
- Forced
=>needed at least for setting up different locales, but there will be more uses of this
The mapping between HTTP_ACCEPT_LANGUAGE & LCID is a bit tricky. Locale ID (LCID) is different for different French speaking countries, but it would be desirable to map them to one of the installed ones (if any). So it will result in a hierarchical decision structure. This link will give you the idea on their use in web development: http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/0700/localize/toc.asp
Beware that the user can have multiple languages selected. For a more detailed discussion check the "Browser sniffing for i18N" from http://www.microsoft.com/globaldev/drintl/001/default.asp ...
Also "Globalization of websites" title in the following link has some answers to you question on another topic: http://www.microsoft.com/GLOBALDEV/DrIntl/017/default.asp < |
Stop the WAR! |
|
|
Deleted
deleted
4116 Posts |
|
Deleted
deleted
4116 Posts |
|
|
Topic |
|