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

前端 未结 4 1412
青春惊慌失措
青春惊慌失措 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:27

      It depends on technology. For example in Java Locale.UK will give you en_GB code (if you care enough to call toString()). This is what you would pass between modules (unless you are passing concrete type) and this is what you would write into configuration files (i.e. faces-context.xml).
      In .Net on the other hand, you would certainly use en-GB.

      en-GB form is definitely more common and in most cases this is the form you should use.

      The different is obvious: the separator :) Otherwise there is no difference (in the meaning, specific technology might impose some constraints on Locale identifier).

      There is no ISO normative document that handles language and country combination, per my knowledge. In Software Internationalization it is part of Locale Model.

    提交回复
    热议问题