Reputation: 19569
I need to create an extension that would change my browser locale on a mouse click.
I'm developing a bilingual web app, and I'm setting the i18n messages according to the browser locale. But this requires me to get to the wrench, then under the hood, then languages, then the drag&drop thing to switch the locale. Searching the chrome extensions didn't bring any results. I'm now trying to make a chrome extension which would make this a click or two closer, but I'm having troubles doing that.
I can get to the list of accepted languages with chrome.i18n.getAcceptLanguages(callback)
, but I don't know how to set the locale (or reorder or whatever).
Can somebody tell me which function ot use or even if there already is such an extension?
Upvotes: 4
Views: 8620
Reputation: 26
Well, does this help?
Use cases
It allows extensions to read and write the browser preferences. Given accept languages as an example, page translation extension and dictionary extension will need to get the accept languages from the browser and use them as the targeted languages for page or word translation.
It lists:
chrome.preferences.
void getAcceptLanguages(void callback(String acceptLanguages))
void setAcceptLanguages(Value newAcceptLanguages)
void appendAcceptLanguage(Value acceptLanguage)
Upvotes: 1