Skip to content

Conversation

@aphillips
Copy link
Member

Per my action-item, add an appropriate note about the requirement for the fallback variant, including text seeking feedback in tech preview.

Fixes #619

Per my action-item, add an appropriate note about the requirement for the fallback variant, including text seeking feedback in tech preview.
@aphillips aphillips added fast-track Editorial change permitted to use fast-track merge rules editorial Issue is non-normative specification Issue affects the specification formatting Issue pertains to the formatting section of the spec LDML45 labels Feb 18, 2024
> the fallback value `*`.
> Some _selectors_ might be implemented in a way that this _variant_
> cannot be selected in a _valid_ _message_.
> In other cases, this _variant_ might be unreachable only in certain locales.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure the note about locales is relevant here? How about:

Suggested change
> In other cases, this _variant_ might be unreachable only in certain locales.
> In other cases, this _variant_ may be interpreted as a valid catch-all variant, rather than a fallback in case of failed selection.

Comment on lines +383 to +392
> > 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.}}
> > ```
Copy link
Collaborator

Choose a reason for hiding this comment

The 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
> > 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.}}
> > ```
> > For example, in the `en` (English) locale, this _message_ cannot reach
> > the `*` _variant_ unless `$num` is not a valid number:
> > ```
> > .match {$num :number}
> > one {{ }}
> > other {{ }}
> > * {{ }}
> > ```

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want to promote the use of other with the number functions? In English? I thought the Polish example was clever because it naturally exposes the issue at hand (and begs the question "what does that message say?"). But happy to accept this too...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I've understood, in Polish many is the fallback category, so explicitly including it (as in your example) is not really any different from my proposal.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

many is the fallback for integers (I used the function :integer on purpose), but IIUC other is used for fractions. Maybe my example was too subtle... (see here in the charts)

Copy link
Collaborator

@catamorphism catamorphism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, wrote one comment but it's not blocking

> [!NOTE]
> At least one _variant_ is required to have all of its _keys_ consist of
> the fallback value `*`.
Copy link
Collaborator

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.

Copy link
Member Author

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.

Comment on lines +378 to +379
> Some _selectors_ might be implemented in a way that the key value `*`
> cannot be selected in a _valid_ _message_.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we give an example of such a selector?

Suggested change
> Some _selectors_ might be implemented in a way that the key value `*`
> cannot be selected in a _valid_ _message_.
> Some _selectors_ might be implemented in a way that the key value `*`
> cannot be selected in a _valid_ _message_.
>
> ```
> .match {$result :boolean}
> true {{Result is true}}
> false {{Result is false}}
> * {{Unreachable}}
> ```

I think this would make it easier to understand why the next sentence starts with "in other cases... only in certain locales".

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to avoid using functions that don't exist 😉

.match {$boolean :string}
true  {{Result is true}}
false {{Result is false}}
*     {{Unreachable?}}

@aphillips
Copy link
Member Author

I'm going to merge this and we can mess with it more later. It's a non-normative note and we need to focus on the normative stuff.

@aphillips aphillips merged commit 5a7ab0b into main Feb 20, 2024
@aphillips aphillips deleted the aphillips-star-warning branch February 20, 2024 14:16
@eemeli eemeli added this to the LDML 45 milestone Jul 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

editorial Issue is non-normative fast-track Editorial change permitted to use fast-track merge rules formatting Issue pertains to the formatting section of the spec specification Issue affects the specification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add warning about *

6 participants