Skip to content

Commit 5a7ab0b

Browse files
authored
Address #619: add a note about * variant (#666)
* Address #619: add a note about `*` variant Per my action-item, add an appropriate note about the requirement for the fallback variant, including text seeking feedback in tech preview. * Address @stasm's comment
1 parent 003be40 commit 5a7ab0b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

spec/formatting.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,30 @@ to provide the _pattern_ for the formatting operation.
372372
This is done by ordering and filtering the available _variant_ statements
373373
according to their _key_ values and selecting the first one.
374374
375+
> [!NOTE]
376+
> At least one _variant_ is required to have all of its _keys_ consist of
377+
> the fallback value `*`.
378+
> Some _selectors_ might be implemented in a way that the key value `*`
379+
> cannot be selected in a _valid_ _message_.
380+
> In other cases, this key value might be unreachable only in certain locales.
381+
> This could result in the need in some locales to create
382+
> one or more _variants_ that do not make sense grammatically for that language.
383+
> > For example, in the `pl` (Polish) locale, this _message_ cannot reach
384+
> > the `*` _variant_:
385+
> > ```
386+
> > .match {$num :integer}
387+
> > 0 {{ }}
388+
> > one {{ }}
389+
> > few {{ }}
390+
> > many {{ }}
391+
> > * {{Only used by fractions in Polish.}}
392+
> > ```
393+
>
394+
> In the Tech Preview, feedback from users and implementers is desired about
395+
> whether to relax the requirement that such a "fallback _variant_" appear in
396+
> every message, versus the potential for a _message_ to fail at runtime
397+
> because no matching _variant_ is available.
398+
375399
The number of _keys_ in each _variant_ MUST equal the number of _selectors_.
376400
377401
Each _key_ corresponds to a _selector_ by its position in the _variant_.

0 commit comments

Comments
 (0)