3

In my application I would allow users in the United States to see pages in German or French when they switch the language. So the region is US and the language is de or fr, what should lead to a constructed locale of de-US or fr-US. That means, French gets displayed, but e.g. the format of dates corresponds to US. What is what I would like achieve.

Are those locales valid? I saw this list for 'valid' US locales:

Cherokee (United States) (chr-US)
English (United States) (en-US)
English (United States, Computer) (en-US-POSIX)
Spanish (United States) (es-US)
Hawaiian (United States) (haw-US)
Lakota (United States) (lkt-US)

Does that mean de-US is not valid and must not be used or created?

I'm aware with such locales I would get only the general fr language, not br-FR. That would be okay for me.

Class Locale doesn't seem to have a problem with such locales.

robsch
  • 9,358
  • 9
  • 63
  • 104
  • 1
    Athough the production of the tags is valid, the authoritative source is http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry To understand language tagging in general, this is a good reference source from the W3C https://www.w3.org/International/articles/language-tags/ – Dragonthoughts Jun 07 '18 at 10:26

0 Answers0