Skip to content

Provide a way to get a number and noun into grammatical agreement. #34

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

Closed
grhoten opened this issue Feb 9, 2020 · 2 comments
Closed
Labels
requirements Issues related with MF requirements list

Comments

@grhoten
Copy link
Member

grhoten commented Feb 9, 2020

Is your feature request related to a problem? Please describe.
It's a common requirement to turn a quantity of something in a message format into something that is grammatically correct. You can have "1 message" or "2 messages" in an English example. For a language like English and many European languages, it's not that hard. If you ever need to pronounce the number, then it's a little harder because you would need to use ICU's rule based number format (RBNF) to do that. If you need to refer to user vocabulary, it's really hard to do normally, especially when you need to apply grammatical case to both the number and noun.

Describe the solution you'd like
I would like some syntax that takes a number and a noun phrase and get them into grammatical agreement. It would use CLDR plural rules to determine the grammatical number form to use for the noun phrase. Ideally it can provide the spoken form of the number by using rule based number format (RBNF) from CLDR. Then it can take the grammatical case of the entire phrase to get them both into agreement.

Describe why your solution should shape the standard
This is really hard to do in message formatting right now, and if it is doable, it requires a lot of copy and paste syntax to do the same thing in Arabic, Hebrew and Russian. It should be as simple as English.

Additional context or examples
Siri already does this in its responses.
Let's Come To An Agreement About Our Words
The following are prerequisite issues: #33 #31 #16

@mihnita
Copy link
Collaborator

mihnita commented Feb 14, 2020

I think that the current icu messageformat + plural is 80% there (ok, 78.6 :-)
It has spellout, and has plurals.
But there are more troubles.
In Romanian two in this messages: "2 dogs" / "2 cats" would be different because dogs are masculine and cats are feminine (gramatical gender)

@mihnita mihnita added the requirements Issues related with MF requirements list label Sep 24, 2020
@aphillips
Copy link
Member

As mentioned in today's telecon (2023-09-18), closing old requirements issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
requirements Issues related with MF requirements list
Projects
None yet
Development

No branches or pull requests

3 participants