Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accept Language list

I would like to react to the Accept_Language that a browser sends to a website.

Does anybody know where I can get a reliable list of all available Accept_Languages that the browser might send to a website?

Thank you very much!

like image 787
tmighty Avatar asked Dec 16 '12 07:12

tmighty


People also ask

What is accept-language?

The Accept-Language request HTTP header indicates the natural language and locale that the client prefers. The server uses content negotiation to select one of the proposals and informs the client of the choice with the Content-Language response header.

How do I change my accept-language?

The user can change the Accept-Language header sent by the browser using the browser's preference settings. E.g., in Chrome, go to “Settings”, click on “Show advanced settings...”, scroll down to “Languages”, click on “Language and input settings...”, and then add languages and drag to order them.

How do I know my language is accepted?

To check this Accept-Language in action go to Inspect Element -> Network check the request header for Accept-Language like below, Accept-Language is highlighted you can see. Supported Browsers: The browsers are compatible with HTTP Accept-Language header are listed below: Google Chrome.

What is accept in header?

The Accept header is used to inform the server by the client that which content type is understandable by the client expressed as MIME-types. By using the Content-negotiation the server selects a proposal of the content type and informs the client of its choice with the Content-type response header.


2 Answers

IANA Language Subtag Registry page

This is the official location where you will find all subtags available for use in language tags.

W3 said it's the authoritative list. Plus, at the link below, there is a lot more information to be had, including descriptions and other ways of understanding the ways people label themselves.

http://www.w3.org/International/techniques/server-setup#multiviews

like image 191
Jared Farrish Avatar answered Sep 22 '22 15:09

Jared Farrish


The IANA Language Subtag Registry page is surely the correct answer, but the list is a bit hard to parse.

I found this github repository that has a few scripts to parse it, and a set of ready-to-use JSON objects you can use in your projects:

https://github.com/mattcg/language-subtag-registry

It looks like the author is updating the repo every time the IANA list gets changed.

like image 37
Pietro Delsante Avatar answered Sep 21 '22 15:09

Pietro Delsante