Is en_UK an illegal locale?

前端 未结 5 1965
孤街浪徒
孤街浪徒 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).

提交回复
热议问题