The first thing I'd do is write a test html page with some JS and try to get it to alert the right answer.
On 12/15/11 1:22 PM, "michael_regert@dell.com" <michael_regert@dell.com> wrote:
I'm trying to get the locale from IE 9. I've written the following, but it is not working as expected. In IE 9, I can add more than one language, so I can add [de], then [de_DE], then [en_US] (listed in that order).
If I call 'navigator.userLanguage.toString', then IE returns en-us, even though I know German is listed first and working (Google comes up in German). I thought maybe it was because it was trying to return an Array of languages, so I changed my code to look for an Array or an Object. Nothing works.
var l10NCodes:Object = null;
var l10nCode:String = null;
/* Try to get the language code from the browser first. The browser returns both
the language code and the country code rather than just the language code alone. */
if (ExternalInterface.available) {
l10NCodes = ExternalInterface.call('navigator.userLanguage');
! ; l10nCode = ExternalInterface.call('navigator.userLanguage.toString');
}
Michael J. Regert
--
Alex Harui
Flex SDK Team
Adobe System, Inc.
http://blogs.adobe.com/aharui
__._,_.___
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
MARKETPLACE
.
__,_._,___
0 comments:
Post a Comment