Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[FEEDBACK] Literal keys contents / values #1028

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

Closed
macchiati opened this issue Feb 20, 2025 · 6 comments
Closed

[FEEDBACK] Literal keys contents / values #1028

macchiati opened this issue Feb 20, 2025 · 6 comments
Labels
LDML47 LDML 47 Release (Stable) Preview-Feedback Feedback gathered during the technical preview

Comments

@macchiati
Copy link
Member

macchiati commented Feb 20, 2025

Bolded is the original source.

Duplicate Variant: ... Literal keys are compared by their contents, not their syntactical appearance.

I think this needs some clarification. The interpretation of a literal depends on the function it is supplied to. Thus 'contents' in that sense is not a data model error. I think what is meant is that |a| is equivalent to a.

If we change "contents" to "value" that helps. We do have the following, although that isn't exactly what we need; and it is off in the Data Model.

Literal represents all literal values, both quoted literal and unquoted literal. The presence or absence of quotes is not preserved by the data model. The value of Literal is the "cooked" value (i.e. escape sequences are processed).

I suggest the following changes.

  1. In the bold quoted line, change "contents" to "values".

  2. In https://unicode.org/reports/tr35/dev/tr35-messageFormat.html#literals, add at the end of the section.

The value of a literal is the text after removing the terminating | characters if the literal is quoted, then unescaping any escaped characters.


An unquoted literal MAY be used when the content of the literal contains no whitespace and otherwise matches the unquoted-literal production.

T​his is misleading: should be:

An unquoted literal MAY be used when the content of the literal matches the unquoted-literal production. It will thus contain no whitespace, nor certain other characters.

@macchiati macchiati added the Preview-Feedback Feedback gathered during the technical preview label Feb 20, 2025
@eemeli
Copy link
Collaborator

eemeli commented Feb 20, 2025

I think this needs some clarification. The interpretation of a literal depends on the function it is supplied to. Thus 'contents' in that sense is not a data model error. I think what is meant is that |a| is equivalent to a.

Yes, "contents" here is meant to mean the string value represented by the syntax. In the Key section, we include this:

The value of each _literal_ _key_ MUST be treated as if it were in
[Unicode Normalization Form C](https://unicode.org/reports/tr15/) ("NFC").
Two _literal_ _keys_ are considered equal if they are canonically equivalent strings,
that is, if they consist of the same sequence of Unicode code points after
Unicode Normalization Form C has been applied to both.

@macchiati
Copy link
Member Author

Two literal keys are considered equal if they are canonically equivalent strings,

|one| is a literal key, and one is a literal key. According to the above |one| is not considered identical to one.

It should be:

Two literal keys are considered equal if their values are canonically equivalent strings,

@aphillips
Copy link
Member

@macchiati Your version is probably clearer. Make a PR?

@macchiati
Copy link
Member Author

Will do

@macchiati
Copy link
Member Author

#1036

@macchiati macchiati added the LDML47 LDML 47 Release (Stable) label Feb 21, 2025
@aphillips
Copy link
Member

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LDML47 LDML 47 Release (Stable) Preview-Feedback Feedback gathered during the technical preview
Projects
None yet
Development

No branches or pull requests

3 participants