I've just been reviewing the internationalization spec:
https://docs.google.com/document/pub?id=1rsUxJQ03Ql6o3bh6RN7J81dtYZXE7OVsdQBw_h5ASnM&ndplr=1&pli=1

First off - hooray! This is long, long, long overdue.

The biggest question I have is with regards to the DateTimeFormat and
NumberFormat. I'm wondering why you've chosen to have these as separate
object types instead of adding methods onto Date.prototype and
Number.prototype, respectively? It doesn't seem like having these as
separate objects provides much more value since they mostly just use their
format() methods.

Smaller question is on specifying the format. The object literal
specification of the format seems overly verbose for dates, and perhaps also
for numbers. I'd really love to be able to do something like this:

var now = Date();
console.log(now.format("hh:mm:ss"));

var price = 1010;
console.log(price.format("#,###"));

I'd hypothesize that most programmers are familiar with this type of
date/numeric formatting strings as they are in use in other languages. I'd
much prefer being able to use a formatting string vs. an object literal with
multiple properties that aren't very transparent as to their consequence.

Just to emphasize: I really like the functionality in the spec, it just
seems more Java-like and verbose than what's in JavaScript right now, and
I'm wondering if there are ways to change that.

Thanks,
Nicholas


________________________________________
Nicholas C. Zakas
http://www.nczonline.net
@slicknet
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to