Where i can see the list of languages and their codes?
I want to compare languages and auto-select required language in template.
Are they cross-browser equal?
Any other solution?
The Navigator language property is used for returning the browser's language version. It is a read-only property and it returns a string representing the language version of the browser. Some of the possible language codes are : en-US.
language : Settings > Advanced > Language > Add Language. then bring this language to the top.
Open the browser settings, and in the advanced section scroll down to find Languages . Open Language and Input Settings and add the language or language+region choice you want from the list available. Order the resulting list so that it is in descending order of preference. You don't need to restart Chrome.
The navigator property of a window (i.e. window. navigator ) is a reference to a Navigator object; it is a read-only property which contains information about the user's browser. Since Window is a global object and it is at the top of the scope chain, so properties of the Window object such as window.
For copy and pasting purposes:
["af", "sq", "ar-SA", "ar-IQ", "ar-EG", "ar-LY", "ar-DZ", "ar-MA", "ar-TN", "ar-OM", "ar-YE", "ar-SY", "ar-JO", "ar-LB", "ar-KW", "ar-AE", "ar-BH", "ar-QA", "eu", "bg", "be", "ca", "zh-TW", "zh-CN", "zh-HK", "zh-SG", "hr", "cs", "da", "nl", "nl-BE", "en", "en-US", "en-EG", "en-AU", "en-GB", "en-CA", "en-NZ", "en-IE", "en-ZA", "en-JM", "en-BZ", "en-TT", "et", "fo", "fa", "fi", "fr", "fr-BE", "fr-CA", "fr-CH", "fr-LU", "gd", "gd-IE", "de", "de-CH", "de-AT", "de-LU", "de-LI", "el", "he", "hi", "hu", "is", "id", "it", "it-CH", "ja", "ko", "lv", "lt", "mk", "mt", "no", "pl", "pt-BR", "pt", "rm", "ro", "ro-MO", "ru", "ru-MI", "sz", "sr", "sk", "sl", "sb", "es", "es-AR", "es-GT", "es-CR", "es-PA", "es-DO", "es-MX", "es-VE", "es-CO", "es-PE", "es-EC", "es-CL", "es-UY", "es-PY", "es-BO", "es-SV", "es-HN", "es-NI", "es-PR", "sx", "sv", "sv-FI", "th", "ts", "tn", "tr", "uk", "ur", "ve", "vi", "xh", "ji", "zu"];
This list of languages is defined by the ISO : http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
Example : be
for belarus, fr
for french.
If you are looking for something more specific, those are not languages, but locale, e.g. "Brazilian Portuguese", or "Canadian French". Those can be found in the ICU project: https://www.localeplanet.com/icu/
Example : pt_BR
for Portuguese (Brazil) vs pt_CV
for Portuguese (Cape Verde)
Those are the ones available for copy/pasting in dYale answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With