Globalization API: supportedLocalesOf vs. getSupportedLocales

Norbert Lindenberg ecmascript at norbertlindenberg.com
Mon Nov 28 17:30:24 PST 2011


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.)



More information about the es-discuss mailing list