[haiku-commits] Re: r39263 - in haiku/trunk: data/artwork src/apps/readonlybootprompt src/kits/locale

  • From: Adrien Destugues <pulkomandy@xxxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 02 Nov 2010 12:04:57 +0100

Known problems :
[...]
  * The way I altered LocaleRoster is not as good as it could be. Locales
  with variants such as zh-hans are not going to work (the computed country
  code is now 'NS'). Not sure there is a better way

Is NS even a valid country code? What exactly is the problem? One would think
it should always be possible to infer some reasonably fitting country from
language, no?

I just took the last two characters of the country code, and this doesn't work when there is a variant (such as -hans, which means "simplified han"). I'm not sure what can be done to decide zh-hans should actually be 'cn' (for china).

There are similar problems with english (the language is 'en' but the country should be 'US'). Some other countries happen to have the same code for language and country, and in these cases, the current code works. (fr_FR, de_DE, ...).

I expect we'll get more 'specialized' translations (such as pt_BR) in the future, so the problem may solve itself in most cases (or we could just force every translation to be linked to a country).

zh-hans is a particular case, this name is used because several countries use the same language and don't want one of them to be used in the language name.

I don't think there is a language > country mapping in ICU. We can get a list of all locales and find one that match the language, but then 'french' may get the belgian flag because BE happens to be first in alphabetical order. Not sure that would make sense.

--
Adrien.

Other related posts: