Does anyone use any made-up locales with GWT? I am getting ready to commit some changes which, among other things, adds support for region-based inheritance and locale aliases. There are two implications of that:
- the code has to be able to understand the structure of the locale tag to know which part means what. Ie, in en_US, is the US a region, script or variant? - the code has to be able to know meanings of particular tags -- ie, iw is the old name for he, so it can map them appropriately as aliases GWT uses CLDR locales, which are in turn based on BCP47<http://www.w3.org/International/core/langtags/rfc3066bis.html>. This provides the structure requirement above, so that US can be determined to be a region while en_Latn means using the Latin script. The subtag registry, linked from the same page, provides the knowledge of what languages are what, if they have been deprecated what the new code is, and what the default script is. Note that since RTL support and plural rules were added in 1.5, there has been built-in knowledge of locale names, but things would still work if you made up your own as long as stripping off underscore separated parts handled inheritance, and you were willing to have to do your own RTL/plural support if you cared about it. This change will mean that you really need to be using BCP47 locales, though there are a couple of escape valves: - x-whatever is a private-use locale tag and can be whatever you want. However, you don't get inheritance. - there are reserved private ranges -- langauges: qaa-qtz, regions: AA, ZZ, QM-QZ, and XA-XZ that can be used for private use Would this cause anyone any problems? Note that what is being implemented is strictly compile-time inheritance/aliasing, not at runtime as the tables in the selection script would be expensive. These classes are alaso available for the server, and when coupled with something like LocaleListLinker you can have your server choose the proper initial locale based on the locales that are actually supported in the app and inheritance rules. So for example, you could have translations just for es_419 (Spanish as spoken in Latin America), yet still get country-specific localizations like date/time/number formats and default currencies. -- John A. Tamplin Software Engineer (GWT), Google --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
