Wednesday, October 16, 2013

Change Browser Language Preference

This week I am doing i18n for our web app using requirejs/i18n plugin, after I get translation done, I need test out by changing my browser language. Browser uses Accept-Language request-header to indicate its preference language. Some browser only has one language in the header, some browser has a list of preference languages with qvalues (quality value). One example is Accept-Language: zh-cn,zh;q=0.5

However, i18n is different from L10N which is more region related.

Internet Explorer
Windows only, go to Tools > Internet Options > General (tab) > Languages > Language preference.

Firefox
Tools > Options (Windows) or Firefox > Preferences (Mac OS X), and select Content (tab) > Languages > Choose (button).

about:config, using intl.accept_languages if want custom language tags

Safari
Mac OS X only. The browser language is that specified in the OS X system language preferences. Go to System Preferences > Language & text > Language.

Safari will only send the top item with the Accept-Language header. You can't create custom language tags.

Chrome
Options (Windows) or Chrome > Preferences (Mac OS X), and select Web Content > Languages & Spellchecker settings.

You can't create custom language tags. Not sure if there is hidden setting for this.

Opera
Menu > Settings > Preferences > General > Language > Details (Windows).
On Mac OS X, similar to Safari, it is the language specified in OS X. If you have a long list of languages in this dialog box, Opera sends all of them with the Accept-Language header.

opera:config and the Network > HTTP Accept Language setting if want custom language tags.

No comments:

Post a Comment