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: localize message extraction producing incorrect equiv-text
values
#39195
Comments
OK, so I did some debugging and this issue is caused by us skipping "leading trivia characters" thanks to this 304a12f. The problem appears because the i18n message begins with a leading space, which is skipped when computing the source-span for the start of the i18n message. This appears to make the source-spans for the inner pieces out of sync. |
Actually things are more complex than just that, although that is part of it... |
…er source-spans Tokenized text node may have leading whitespace skipped from their source-span. But the source-span is used to compute where there are interpolated blocks, resulting in placeholder nodes whose source-spans are offset by the amount of skipped characters. This fix uses the `fullStart` location of text source-spans for computing the source-span of placeholders, so that they are accurate. Fixes angular#39195
…er source-spans Tokenized text node may have leading whitespace skipped from their source-span. But the source-span is used to compute where there are interpolated blocks, resulting in placeholder nodes whose source-spans are offset by the amount of skipped characters. This fix uses the `fullStart` location of text source-spans for computing the source-span of placeholders, so that they are accurate. Fixes angular#39195
…er source-spans Tokenized text node may have leading whitespace skipped from their source-span. But the source-span is used to compute where there are interpolated blocks, resulting in placeholder nodes whose source-spans are offset by the amount of skipped characters. This fix uses the `fullStart` location of text source-spans for computing the source-span of placeholders, so that they are accurate. Fixes angular#39195
…er source-spans (#39486) Tokenized text node may have leading whitespace skipped from their source-span. But the source-span is used to compute where there are interpolated blocks, resulting in placeholder nodes whose source-spans are offset by the amount of skipped characters. This fix uses the `fullStart` location of text source-spans for computing the source-span of placeholders, so that they are accurate. Fixes #39195 PR Close #39486
…er source-spans Tokenized text node may have leading whitespace skipped from their source-span. But the source-span is used to compute where there are interpolated blocks, resulting in placeholder nodes whose source-spans are offset by the amount of skipped characters. This fix uses the `fullStart` location of text source-spans for computing the source-span of placeholders, so that they are accurate. Fixes angular#39195
…er source-spans Tokenized text node may have leading whitespace skipped from their source-span. But the source-span is used to compute where there are interpolated blocks, resulting in placeholder nodes whose source-spans are offset by the amount of skipped characters. This fix uses the `fullStart` location of text source-spans for computing the source-span of placeholders, so that they are accurate. Fixes angular#39195
…er source-spans (#39589) Tokenized text node may have leading whitespace skipped from their source-span. But the source-span is used to compute where there are interpolated blocks, resulting in placeholder nodes whose source-spans are offset by the amount of skipped characters. This fix uses the `fullStart` location of text source-spans for computing the source-span of placeholders, so that they are accurate. Fixes #39195 PR Close #39589
I made some tests with last Angular 11 and I always have bad translation: <unit id="MAD.confirmDeleteModalMsg">
<notes>
<note category="location">src/app/components/setup/zone/detail/zone-detail.component.html:14,16</note>
<note category="location">src/app/components/setup/wall/panel-setup/panel-setup.component.html:56,58</note>
<note category="location">src/app/components/setup/vc/setup-panel/vc-setup-panel.component.html:10,12</note>
<note category="location">src/app/components/setup/ps/setup-panel/ps-setup-panel.component.html:7,9</note>
</notes>
<segment>
<source> Confirm delete <ph id="0" equiv="INTERPOLATION" disp="e {{uiName"/>?
</source>
</segment>
</unit> for the original text to translate: <mad-modal-confirm i18n="@@MAD.confirmDeleteModalMsg" i18n-title="@@psSetupPanel.modalConfirmTitle" title="Delete Power Supply" size="md" id="deletePowerSupplyButton" (closed)="deletePowerSupplyConfirm($event)">
Confirm delete {{uiName}}?
</mad-modal-confirm> I'm really disappointed because I like the new Angular 11 version but I cannot migrate my project with this show stopper. For me it's not corrected and I don't understand why this issue was closed. |
@bougnat12 see #39671 |
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. |
(See #38711 (comment) for original report)
Extraction of i18n messages from the following template HTML:
Without ivy: (ctype attributes removed for clarity)
With ivy:
It seems that there is some offsetting going on, which is making the start and end points in the equiv-text appear in the wrong place. I'll need to debug into this but since these equiv-text attributes are primarily to aid the translator's job, it will not be high on my priority list. Hopefully I can take a look at it later next week or the week after.
The text was updated successfully, but these errors were encountered: