Globalization API discussion

Nebojša Ćirić cira at google.com
Thu Nov 17 10:33:54 PST 2011


Hi all,
 there were couple concerns yesterday about the API (some concrete, some
vague), and we would like to resolve those as soon as possible. Here is the
list of issues I got yesterday (I am sure there's more we didn't manage to
cover):

Q. We need a way to set default locale (per context). Currently one can
only read its value by constructing LocaleList without parameters.
A. A global defaultLocale (attached to Globalization namespace) was
proposed. I agree with the idea.

Q. Move LocaleList parameter in all constructors to options parameter.
A. This would help avoid putting "undefined" as first parameter if we are
happy with the defaults.

Q. API is too Java like. Use shorthand to invoke formatters.
A. I would like to hear proposals on how to make it more JS like. Adding
shorthand syntax is easy, but most of TC39 members were against having 2
ways of doing things first time we proposed it.
Here is an example of current API in action -
http://codepaste.appspot.com/show?id=592122&revid=589126

Q. We don't use option parameter like that in JS (see previous point for
actual example)
A. What is a proper way of passing variable list of parameters that lets
you extend the list in the future in an easy way? All of the properites in
the options object are optional (with some exceptions)

 Feel free to start a new email thread for hot topics.

-- 
Nebojša Ćirić
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111117/4c07b4df/attachment.html>


More information about the es-discuss mailing list