-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
i18n: Reference ICU ids from container messages #43534
i18n: Reference ICU ids from container messages #43534
Conversation
8993675
to
a37cba3
Compare
4c720d6
to
43e4d95
Compare
@petebacondarwin I've started looking at the change, but I need another day or two to complete the review process. Meanwhile, I've started a presubmit to see if the changes breaks anything. |
...ages/compiler-cli/test/compliance/test_cases/r3_view_compiler_i18n/icu_logic/TEST_CASES.json
Show resolved
Hide resolved
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.
@petebacondarwin looks great 👍
43e4d95
to
1a59de1
Compare
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.
👍
FYI, initial presubmit looks good, I will run a bit more tests in g3 and keep this thread updated. |
When extracting i18n messages, the Angular compiler needs to split ICU expressions into their own message. Currently there is no guaranteed way to re-associate the ICU message with the original message where the ICU was found. This change adds support in the localize tooling so that associated ids can be stored as metadata in the `$localize` tagged strings. These ids can then be used in generated translation files to provide a link between the two messages. The XLIFF 1.2 and 2.0 formats have been updated to render these relationships, via the `xid` and `subFlows` attributes respectively.
When extracting i18n messages from templates, ICU messages are split out from the message that contains them. This can make it difficult in the translation files to match up the two messages, especially if the ICU is reused in multiple placeholders. This commit builds on top of the previous one to expose the message ID of ICU messages from the ICU placeholders as additional metadata in the `$localize` tagged strings. Now the metablock following any placeholder can also contain the associated ID delimited from the placeholder name by `@@`. Fixes angular#17506
1a59de1
to
df3dd11
Compare
@petebacondarwin presubmits for the changes in this PR are successful + extra testing went well, so this PR is good to go from g3 perspective. |
This PR was merged into the repository by commit c85bcb0. |
…3534) When extracting i18n messages from templates, ICU messages are split out from the message that contains them. This can make it difficult in the translation files to match up the two messages, especially if the ICU is reused in multiple placeholders. This commit builds on top of the previous one to expose the message ID of ICU messages from the ICU placeholders as additional metadata in the `$localize` tagged strings. Now the metablock following any placeholder can also contain the associated ID delimited from the placeholder name by `@@`. Fixes #17506 PR Close #43534
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
When extracting i18n messages from templates, ICU messages are split out from the
message that contains them. This can make it difficult in the translation files to match up
the two messages, especially if the ICU is reused in multiple placeholders.
Fixes #17506
Local testing in the AIO project allows us to generate XLIFF that looks like:
Note that the
<x id="ICU"...>
has anxid
attribute that matches theid
of the ICU message later in the file.