Is en_UK an illegal locale?

前端 未结 5 1833
孤街浪徒
孤街浪徒 2021-02-02 05:17

So far I had always used \'en_UK\' for British English. Today I got an error when using it with Zend Framework because the locale is not included in the long list of recognized

相关标签:
5条回答
  • 2021-02-02 05:37

    The correct country code is en_GB. Locales use ISO 3166-1 for country codes. The wikipedia writeup includes:

    The codes are chosen, according to the ISO 3166/MA, "to reflect the significant, unique component of the country name in order to allow a visual association between country name and country code".[7] For this reason, common components of country names like "Republic", "Kingdom", "United", "Federal" or "Democratic" are normally not used for deriving the code elements. As a consequence, for example, the United Kingdom is officially assigned the alpha-2 code GB rather than UK, based on its official name "United Kingdom of Great Britain and Northern Ireland" (although UK is reserved on the request of the United Kingdom).

    0 讨论(0)
  • 2021-02-02 05:39

    Imperfect implementations

    Starting in 1985, ISO 3166-1 alpha-2 codes have been used in the Domain Name System as country code top-level domains (ccTLDs). The Internet Assigned Numbers Authority currently assigns the ccTLDs mostly following the alpha-2 codes, but with a few exceptions.[9] For example, the United Kingdom, whose alpha-2 code is GB, uses .uk instead of .gb as its ccTLD, as UK is currently exceptionally reserved in ISO 3166-1 on the request of the United Kingdom.

    According to wikipedia http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2.

    So apparently it's an old thing that has stuck or something like that.

    EDIT: martin clayton found a better answer.

    0 讨论(0)
  • 2021-02-02 05:48

    the correct country code in ISO 3166 for the United Kingdom of Great Britain and Northern Ireland is for some reason "GB", so the locale code should be en_GB, and not en_UK as noted here.

    en_GB is also used by glibc, gnome, kde, etc

    Also i like the fact that many previous bug fixes in opensource projects are related to this like in apache http 1.3 and roundcube project

    0 讨论(0)
  • 2021-02-02 05:49

    You cannot simply invent locales! They are already defined. So "en-gb" is British English, whereas "en-us" is American English. If you use "en-uk", you are just making up a code.

    As to why the official code is "en-gb" and not "en-uk", I think basically because there is no such thing as United Kingdom English. The language variant is British. Note that the difference between Great Britain and the United Kingdom is:

    UK = GB + Northern Ireland

    So by naming the variant "en-UK" it's as if you are saying that you want to include the way they speak in Northern Ireland within this category. But why would you want to do that? From a linguistic perspective it makes no sense, as Northern Ireland English is closer to Irish English (en-IE) than British English.

    0 讨论(0)
  • 2021-02-02 05:57

    It is indeed a common (?) mistake. en_UK is wrong. The ISO country code for the UK is GB, making the language tag en_GB.

    0 讨论(0)
提交回复
热议问题