-
-
Notifications
You must be signed in to change notification settings - Fork 36
Support conditional spans of text #37
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
I recently learned about Google's Common Expression Language spec which has a number of comparison behaviors based around the input being an expression as a string. Would it make sense to design this syntax to provide a list of potential messages and their conditions, and then pick the first one that meets the criteria?
I would also want to make sure the input types for these conditionals can be dynamically defined by the application, ie.
|
I just made up the syntax, mainly to capture the spirit of the idea and certain requirements like handling application-specific structured data. |
I really don't think that we should try to stay away from converting this into a "Turing complete language" Yes, it's powerful, and (as developers) was all like that. If |
Translating this issue into the current state of MFv2 (and asking for @grhoten to correct me if I'm wrong), I think this is a request to add some selector functions to the registry beyond simple string equality, for example:
Most of this issue appears to be have been addressed by the creation of the |
As mentioned in today's telecon (2023-09-18), closing old requirements issues. |
Is your feature request related to a problem? Please describe.
There should be a generic way to handle conditionals. When getting words into grammatical agreement, word choice can depend on the grammatical properties and values of other words.
Issue #21 goes into a discussion about ranges that is similar to ICU ChoiceFormat. It seems like shorthand to needing a more complete conditional handling. Issue #31 goes into detecting grammatical category values (grammemes), but you need to act upon a given value. A translator may need to choose a different verb or adjective depending on the noun inserted into a message.
Describe the solution you'd like
I'll try to avoid using the XML or UEL syntax that I'm used to using in the solution description. I'll just state what should be considered.
Describe why your solution should shape the standard
This is a way to get words to agree with each other. The several message formatting options from ICU don't have the same syntax. It would be better if it were consistent for handling conditionals to ease the learning curve.
Additional context or examples
#21
ICU ChoiceFormat
ICU PluralFormat
ICU GenderFormat
The text was updated successfully, but these errors were encountered: