Ticket #38 (closed enhancement: fixed)

Opened 4 years ago

Last modified 3 years ago

Use locale instead of the language name (ie: en_US vs. en)

Reported by: vivien Owned by:
Priority: major Milestone:
Component: Localization Version:
Keywords: Cc:

Description

In order to differentiate between different variant of a language Unicorn should be able to use and store in the language property files the locale name rather than the 2 letter language code as currently we can't have two versions one in en_US and one in en_GB (or de_DE and de_CH).

Also the name of the corresponding locale should not be stored in the property file but retrieved directly using the getDisplayName function.

See:  http://java.sun.com/developer/technicalArticles/J2SE/locale/

Attachments

Change History

Changed 4 years ago by tgambet

The second part is done, the language name is no longer necessary in the properties files.

Changed 3 years ago by tgambet

  • status changed from new to closed
  • resolution set to fixed

Unicorn now uses ICU4J for locale management. It still can't differentiate between en_US and en_GB as it would be useless in our case but it can now differentiate between zh_Hans and zh_Hant for example (traditional vs simplified chinese) or az_Cyrl and az_Latn (Cyrillic vs Latin Azerbaijani). With the new locales provided by ICU4J and script differentiation we can now translate Unicorn in about 150 languages.

Unicorn guesses the best locale to use according to the user preferences. For example someone asking for zh_TW will be served Unicorn in zh_Hant as zh_TW is oftenly used in place of the correct locale zh_Hant_TW.

Moreover if Unicorn is not available in zh_Hans but is available in zh_Hant, zh_Hant will be used as it is likely that this user will understand both traditional and simplified chinese (he will still have a message inviting him to translate Unicorn in zh_Hant). The same is true for serbo-croation variants which are very close or for danish and norwegian.

Finally if a user tries to translate Unicorn using a locale containing geographic information (like es_AR) Unicorn will automatically fallback to the correct locale (es in that case) and display a message: The requested language "español (Argentina)" has been changed to the fallback language "español" instead. If you think this is not right please make a request on <a mailto>our public mailing-list</a>.

Add/Change #38 (Use locale instead of the language name (ie: en_US vs. en))

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.