Accept Language list

时光怂恿深爱的人放手 提交于 2019-12-09 08:35:30

问题


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!


回答1:


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




回答2:


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.



来源:https://stackoverflow.com/questions/13899550/accept-language-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!