8000 We should not require `*` if the variant keys exhaust all possibilities · Issue #603 · unicode-org/message-format-wg · GitHub
[go: up one dir, main page]

Skip to content
We should not require * if the variant keys exhaust all possibilities #603
Closed
@eemeli

Description

@eemeli

As currently specified, we require at least one variant of each .match message to have only * keys. Otherwise, we consider the message to have a Missing Fallback Variant data model error.

This requirement ensures that no matter the case, selection on a valid message will always produce some explicitly defined pattern.

It is however possible to define selectors such as :plural or :boolean for which the presence of some set of keys guarantees that selection will succeed, such as ['other'] for the former and ['true', 'false'] for the latter.

If we were to make the current error a runtime Selection Error like "No Variant Selected" instead of a Data Model Error, it would allow for more natural messages, such as:

.match {$exists :boolean}
true {{You have the thing.}}
false {{You don't have it.}}

instead of our current

.match {$exists :boolean}
true {{You have the thing.}}
* {{You don't have it.}}

With access to a registry definition, it would still be possible to validate messages for completeness.

An outline of the changes required for this are available in #560 (comment).

I'm assigning this to @stasm, as he mentioned this topic near the end of today's call, and I just wanted to be sure we had an issue filed on this. Please feel free to take over here.

Metadata

Metadata

Assignees

Labels

LDML48LDML48 ReleaseSeek-Feedback-in-PreviewIssue should be something we seek feedback on in the tech preview periodformattingIssue pertains to the formatting section of the specfunctionsIssue pertains to the default function setsyntaxIssues related with syntax or ABNF

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0