Globalization API: supportedLocalesOf vs. getSupportedLocales

Shawn Steele Shawn.Steele at microsoft.com
Mon Nov 28 17:37:24 PST 2011


There are 6000+ languages, and presumably any of them could be spoken in 200+ regions.  There are additionally many variations of some of these languages.  So that's not a thousand locales, that's over a million locales.  Additionally there may be legitimate tags an application can support that it may have been originally designed for.  (Perhaps a new language or region or variant)  For an application that doesn't care much about the input locale, that's a lot of room for variety.

For applications that are only localized to a certain number of languages, then perhaps a getSupportedLocalizations() would be manageable.  Again though, that scope is narrow and may be inappropriate to use in other contexts.  Eg: my app is localized to only English, but someone uploaded French content, does that count?

-Shawn

-----Original Message-----
From: es-discuss-bounces at mozilla.org [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Norbert Lindenberg
Sent: Monday, November 28, 2011 5:30 PM
To: Eric Albright; Peter Constable; Shawn Steele
Cc: es-discuss
Subject: Re: Globalization API: supportedLocalesOf vs. getSupportedLocales

We invented the supportedLocalesOf method to let applications find out which of its requested locales are supported by the implementation of a service. A getSupportedLocales function that simply returns the locales that the implementation actually supports would be easier to understand, and could also be used by an application to implement its own locale negotiation. If I remember correctly, we chose not to offer getSupportedLocales primarily because the list returned might be huge - possibly over 1000 locales.

Maybe we should reconsider this? If an application really wants to have a list of 1000 locales, why not let it have it? If we want the ability to restrict the list, maybe there can be locale list as a parameter, and we return only those supported locales for which a prefix is on the locale list passed in? Or is there a more fundamental issue with getSupportedLocales?

Thanks,
Norbert 


On Nov 21, 2011, at 11:12 , Nicholas C. Zakas wrote:

> 2. supportedLocalesOf
> 
> I find this method name strange - I've read it several times and am still not sure I fully understand what it does. Perhaps "getSupportedLocales()" is a better name for this method? (I always prefer methods begin with verbs.)

_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss




More information about the es-discuss mailing list