Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

navigator.language list of all languages

Tags:

javascript

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?

like image 302
Somebody Avatar asked Apr 07 '11 12:04

Somebody


People also ask

What is navigator language?

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.

How do I change the language on navigator?

language : Settings > Advanced > Language > Add Language. then bring this language to the top.

How do I check my browser language?

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.

What is Window navigator?

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.


2 Answers

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"]; 
like image 158
dYale Avatar answered Oct 13 '22 17:10

dYale


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.

like image 41
Clement Herreman Avatar answered Oct 13 '22 15:10

Clement Herreman