What is a good definition for language code and locale codes?

前端 未结 4 1450
青春惊慌失措
青春惊慌失措 2021-01-31 08:59

  • When to use en_GB and en-GB ?
  • What is the difference ?
  • Is there an ISO name for this ISO 639-1 (language) and ISO 3166
  • 4条回答
    •  谎友^
      谎友^ (楼主)
      2021-01-31 09:37

      A locale is a combination of language and region (usually a country).

      The separator ca be _ or -, but the recommended one is dash.

      Probably you are looking for BCP-47 standard that make use of language codes from ISO 639-1 and region/country codes from ISO 3166-1 alpha-2 (usually written in upper case).

      You can find more information about them here http://blog.i18n.ro/simplified-locale-codes/

    提交回复
    热议问题