doufu8127 2016-03-18 00:06 采纳率: 100%
浏览 60
已采纳

ISO 639 - PHP中可靠的查找资源

Intl Extension Uses The RFC 4646 Language Tag

In the PHP intl extension, specifically the Locale class, it says:

Locales are identified using RFC 4646 language tags

RFC 4646 is deprecated

The reason I mention this is that RFC 4646 has been deprecated in favour of RFC 5646.

I had intended to use the intl extension to translate ISO 639 codes to their respective language name (e.g. en to English). Whilst this is not essential, it would be a helpful ability to have available.

ISO 639 changes frequently

The 639 language codes are actively maintained and altered by their respective registration authorities. This is not a hypothetical concern either, just see the change-log for ISO 639-3.

The use of the now deprecated language tag leaves me a little concerned about how actively the intl extension is being maintained; RFC 5656 was released in 2009, this is hardly a cutting edge standard.

Question

  • Are the ISO-639 language codes used by intl updated regularly?
  • Can intl be relied upon as an authoritative lookup resource for ISO 639?
    • If not, is there an authoritative lookup resource for ISO 639 in PHP?
  • 写回答

1条回答 默认 最新

  • duanhuai7532 2016-03-18 01:27
    关注

    The intl extension relies on ICU to supply language codes, among other things. The ICU version is stored in the constant PHP_ICU_VERSION. ICU itself relies on the Unicode Common Locale Data Repository (CLDR) as specified in the same documentation you cited in the Locale class: "The extensions used by CLDR in [Unicode Standard Annex] #35 (and inherited by ICU) are valid and used wherever they would be in ICU normally."

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?