-
-
Notifications
You must be signed in to change notification settings - Fork 36
Friction points when adding the first functions to the registry #422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do we want a "gender" function now, or leave it for later? |
From @eemeli
In this context:
|
From @aphillips
Context:
|
Bigger theme: what are we doing if certain things are incomplete / controversial in ECMAScript? |
From @macchiati
To discuss where can we put this kind of info. I don't think the registry is flexible enough to handle this. Ideas:
|
Basically, for plurals, whenever any value of $count is formatted differently than another, it is a likely mistake. And that includes the implicit "formatting" involved in a match. The following, for example will likely be a failure in some language. FAIL And this: FAIL And so on. This, on the other hand is ok, because whatever the default formatting of $count is, it is used for both. OK Also ok: OK OK So we should recommend that a "message formatter linter" identify and flag the bad cases, since they can be identified fairly easily. Can't stop all bad cases, but l meglio è nemico del bene. |
On gender. ICU just uses the string select for personal gender. That has some disadvantages. Because it is not a closed set, software can't recognize when there are faulty values (eg simple typos like "fernale"). Translation software also can't "flesh out" a message by adding alternatives that don't exist in the original source. Suppose the original message is in French, for example, with two genders. The translation software can't recognize that that should be expanded for languages that more than two commonly-used personal genders (eg he/she/they in English, han/hon/hen Swedish, ...), or contracted for languages that only have a single personal gender (eg Turkish). So I recommend having a :gender selector. |
From eemeli@
|
@mihnita I think this issue was super-useful in documenting what you ran into in creating #420. What are the next steps for this issue? Can we close this in favor of specific tasks? Regarding |
I think that describing / validating values with regexp is not powerful enough. Should I open an issue (so that we can close this one?) For gender there is this section in TR 35: These values are already used by some formatters, and I think by number spellout. Android also added some minimal gender support, for the gender of the user only (so no worries about iOS has something too (https://developer.apple.com/documentation/foundation/nsgrammaticalgender) So I think it might be good to have some minimal level of support: the name of the selector, and a list of values. And we can add more later. But at least we know that people don't use Should I open an issue for gender and we can close this one? |
Thanks @mihnita ! I don't think the question is whether there exists some grammatical gender support, but whether we should require every implementation of MF2 to provide such a feature in 2.0. I don't think that makes sense, since the APIs and CLDR data available are still somewhat primitive. ICU4J could provide such an API, if you think it's ready and we could incubate future support. Does that make sense? PS> Yes, if you want to discuss further, please do open an issue! |
I don't think it is high priority for the release. Even if I open an issue, I would not consider that critical for the release (because it is not spec, it is registry). Way-back-when I created |
I slightly disagree. Yes, the registry is separate from the spec on some level. But it is designed to be normative. There could be non-normative extensions that are recommended.
Yes: I created the |
per discussion in 2024-02-05, closing |
The PR #420 tries to add a first few functions to the registry.
Since this is the first time we try to put something in the registry, it is a learning experience.
I've noticed some areas that would benefit from a discussion, can be used to derive more generic guidelines,
or update the registry description, or need more explaining.
So here there are, captured with not obvious order:
Registry improvements
I found that regexp / list of value mechanism is not powerful enough to describe all things we might want, especially for input.
ISO 8601 is one example: https://en.wikipedia.org/wiki/ISO_8601
And, as Addison noted, ISO8601 and RFC3339 are in the process of being extended to support of Temporals.
One can also imagine phone numbers, emails, urls, measurement, intervals, time duration etc.
Even the describing numbers is difficult. The current regex does not allow certain things that one would
reasonably expect, and allows certain things that one might find unusual.
So the current regex in patterns are to be seen as placeholders until we have something better.
List of values are also not enough, several comments were about the 20+ options in the number formatting
(maximumFractionDigits, minimumSignificantDigits, maximumSignificantDigits)
One idea: probably a minimal option would be an URL?
Another idea: use XML Schema instead of DTD.
It is a bit richer in datatypes, and can also define new types.
But it is probably still not powerful enough.
Options left out
The first batch is strongly influenced by the ECMAScript
Intl
, intersected with what ICU can do today,and also keeping the back of the head what current OS APIs can do.
Some areas of ECMAScript were left out, as they don't seem to have a be too portable:
localeMatcher
formatMatcher
hour12
. It looks like it overlaps withhourCycle
?Experimental options: left out
We left out all the Experimental options in
Intl.NumberFormat
:signDisplay@negative
,useGrouping
,roundingMode
,roundingPriority
,roundingIncrement
,trailingZeroDisplay
Functions left out
For now we ignored the functions that are ICU only or ECMAScript only.
list formatting : ECMAScripy only
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat
relative time formatting : ECMAScripy only
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat
spellout : ICU only
duration : ICU only
ICU has relative time and list formatting, but not in MessageFormat.
Adding function wrappers to have them in MessageFormat 2 is a simple.
In fact list formatting is already in the ICU4J implementation, in a unit test.
It took about 40 lines of code.
The text was updated successfully, but these errors were encountered: