-
Notifications
You must be signed in to change notification settings - Fork 13
feedback from @eemeli on the first draft #1
Comments
Good catch. We have two options here: a) make explicit reference to %RelativeTimeFormat% (which is the other proposal), instead of using the abstract operations directly, in which case we can delegate the plural form selection, and we can work on that other piece of the puzzle to consider "1.0" vs 1. b) adding more logic here to consider string values. I wonder what's the deal here, do you have a link to the details about this logic?
"1.2.3 Internal slots" is the one describing how the implementation uses |
This probably should've been made into two separate issues, but it's perhaps a bit late for that.
I'm not exactly sure what you're asking here, but the Unicode CLDR uses LDML Language Plural Rules to define its pluralization rules. For an implementation of mapping those to JavaScript, I've built make-plural.js. Which, btw, I should be able to turn into a polyfill for this, once the spec is ready for that. Does some part of that answer your question?
Ok, so there's an assumption made in 1.2.3 that doesn't match the current state of affairs. Specifically, this part:
The CLDR, which is probably the most comprehensive source of these functions, currently (v28) contains cardinal pluralization rules for 199 languages, but ordinal pluralization rules for only 84 languages. So would a conforming implementation that used the CLDR for its source data need to limit its supported locales to those 84? I would recommend the spec be relaxed a bit, with something like this: - Each of these properties in turn must be a function.
+ Each of these properties in turn must either be null or a function. The next sentence also needs fixing, due to the above-mentioned issue: - These functions expect a numeric argument and the return
+ These functions expect a numeric or string argument and the return
must be string value "zero", "one", "two", "few", "many" or "other". |
Ok, lets clear up the second part first: The spec does not reference to CLDR structure, nor the details on how the runtime resolves data from CLDR or any other similar structure (in the case of Edge, the internal MS implementation). This is what we don't care much about that part. Even our own implementation of the extractor (https://github.com/yahoo/grunt-extract-cldr-data) does the proper compilation to produce the right data per locale, completing the structure automatically. The same can be done by implementers, and that's the position of the committee. In other words, it is the responsibility of the runtime to fill the blanks of CLDR to provide |
Sure, but given that ordinal rules are not available for all locales, this means that a conforming implementation will need to either make a smaller set of locales available than it could otherwise, or to return a stub My argument here is that if ordinal rule support is not required for every locale, or if there's a way to indicate that the function is a stub, runtime implementations of the spec will be less problematic. |
|
Ok, @ericf explained me what you're asking for, so here is what is going on, step 12:
that's a call to abstract operation http://tc39.github.io/ecma402/#sec-ResolveLocale In this case, we use
Let me play around with this today, and we can make a decision. Just to make sure we are on the same page: "we want to resolve to the locale that not only have |
@eemeli this is now fixed. |
@eemeli let's have the discussion around this draft here
on behalf @eemeli:
The text was updated successfully, but these errors were encountered: