-
-
Notifications
You must be signed in to change notification settings - Fork 35
Address #619: add a note about * variant
#666
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -372,6 +372,30 @@ to provide the _pattern_ for the formatting operation. | |||||||||||||||||||||||||||||||||||||
| This is done by ordering and filtering the available _variant_ statements | ||||||||||||||||||||||||||||||||||||||
| according to their _key_ values and selecting the first one. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| > [!NOTE] | ||||||||||||||||||||||||||||||||||||||
| > At least one _variant_ is required to have all of its _keys_ consist of | ||||||||||||||||||||||||||||||||||||||
| > the fallback value `*`. | ||||||||||||||||||||||||||||||||||||||
| > Some _selectors_ might be implemented in a way that the key value `*` | ||||||||||||||||||||||||||||||||||||||
| > cannot be selected in a _valid_ _message_. | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+378
to
+379
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about we give an example of such a selector?
Suggested change
I think this would make it easier to understand why the next sentence starts with "in other cases... only in certain locales". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd like to avoid using functions that don't exist 😉 |
||||||||||||||||||||||||||||||||||||||
| > In other cases, this key value might be unreachable only in certain locales. | ||||||||||||||||||||||||||||||||||||||
| > This could result in the need in some locales to create | ||||||||||||||||||||||||||||||||||||||
| > one or more _variants_ that do not make sense grammatically for that language. | ||||||||||||||||||||||||||||||||||||||
| > > For example, in the `pl` (Polish) locale, this _message_ cannot reach | ||||||||||||||||||||||||||||||||||||||
| > > the `*` _variant_: | ||||||||||||||||||||||||||||||||||||||
| > > ``` | ||||||||||||||||||||||||||||||||||||||
| > > .match {$num :integer} | ||||||||||||||||||||||||||||||||||||||
| > > 0 {{ }} | ||||||||||||||||||||||||||||||||||||||
| > > one {{ }} | ||||||||||||||||||||||||||||||||||||||
| > > few {{ }} | ||||||||||||||||||||||||||||||||||||||
| > > many {{ }} | ||||||||||||||||||||||||||||||||||||||
| > > * {{Only used by fractions in Polish.}} | ||||||||||||||||||||||||||||||||||||||
| > > ``` | ||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+383
to
+392
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would this be a simpler example for what's being demostrated here?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really want to promote the use of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I've understood, in Polish There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||
| > In the Tech Preview, feedback from users and implementers is desired about | ||||||||||||||||||||||||||||||||||||||
| > whether to relax the requirement that such a "fallback _variant_" appear in | ||||||||||||||||||||||||||||||||||||||
| > every message, versus the potential for a _message_ to fail at runtime | ||||||||||||||||||||||||||||||||||||||
| > because no matching _variant_ is available. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| The number of _keys_ in each _variant_ MUST equal the number of _selectors_. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
| Each _key_ corresponds to a _selector_ by its position in the _variant_. | ||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sentence is a little awkward, but I can't think of a good way to rephrase it.
Unless you do something like:
"An exhaustive variant is required. In an exhaustive variant, every key must be the fallback value
*."Not a big deal, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The phrasing is a bit chewy. I didn't want to create a new term like "exhaustive variant" just for the note.