What I need to know is:
self explaining image 开发者_开发知识库:)
Is this language selection possible in the Chrome Browser?
Would the internalization API work for you? http://code.google.com/chrome/extensions/i18n.html
If you want to get the systems language from Windows Language bar, you would need to use NPAPI http://code.google.com/chrome/extensions/npapi.html to get the language. You would need to create a plugin that fetches the windows settings for language and use that for your extension.
That might be a valid request for i18n, perhaps create an issue for that http://crbug.com/new
below code shows the user language
alert(window.navigator.language);//works both in Mozilla and chrome
alert(navigator.language);//works both in Mozilla and chrome
alert(navigator.userLanguage);// Works in IE
JSfiddle link
If you need something different than the i18n API Mansour mentioned, use navigator.language
.
精彩评论