Repository navigation
Closed
Labels
P4A relatively minor issue that is not relevant to core functionsA relatively minor issue that is not relevant to core functionsarea: i18nIssues related to localization and internationalizationIssues related to localization and internationalizationbreaking changesfreq1: lowstate: confirmedtype: bug/fixworkaround4: none
Milestone
Description
I'm submitting a ... (check one with "x")
[x] bug report => search github for a similar issue or PR before submitting
Current behavior
Actually I have
<span class="slds-form-element__help" *ngIf="form.get('sapNumber').errors?.maxlength" i18n>Maximum de {{max8}} caractères autorisé.</span>
<span class="slds-form-element__help" *ngIf="form.get('interfaceAccountNumber').errors?.maxlength" i18n>Maximum de {{max15}} caractères autorisé.</span>
<span class="slds-form-element__help" *ngIf="form.get('formDesignation').errors?.maxlength" i18n>Maximum de {{max20}} caractères autorisé.</span>
<span class="slds-form-element__help" *ngIf="form.get('shortDesignation').errors?.maxlength" i18n>Maximum de {{max35}} caractères autorisé.</span>
and when I extract with "./node_modules/.bin/ng-xi18n" --i18nFormat=xmb I get 4 times same strings to translate with different ID in my messages.xmb file. All others strings aren't duplicated but this one is, why ?
<msg id="4591664065864994257">Maximum de <ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> caractères autorisé.</msg>
<msg id="3596670943450897156">Maximum de <ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> caractères autorisé.</msg>
<msg id="27126914192147611">Maximum de <ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> caractères autorisé.</msg>
<msg id="8495459888526831686">Maximum de <ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> caractères autorisé.</msg>
N.B. I tried with {{15}} interpolation, I tried with max15 : string = "15" I tried with max15 : number = 15 and same behavior !
Expected behavior
Extract only one time this i18n string.
Please tell us about your environment: webstorm 2017.1
-
Angular version: 4.0.0
-
Language: [ts 2.2.1]
-
Node (for AoT issues):
node --version= v7.7.2
Reacted by João Dias, Ville Lahdenvuo-Malta and tatsujb
Metadata
Metadata
Assignees
Labels
P4A relatively minor issue that is not relevant to core functionsA relatively minor issue that is not relevant to core functionsarea: i18nIssues related to localization and internationalizationIssues related to localization and internationalizationbreaking changesfreq1: lowstate: confirmedtype: bug/fixworkaround4: none
Activity
[-]i18n traduction duplicated[/-][+]i18n translation duplicated[/+]ocombe commentedon Mar 30, 2017
Hmm definitely a bug, even those 2 tags will generate two different ids just because of the extra spaces inside of the interpolation:
--> working on it
elvisbegovic commentedon Mar 30, 2017
just wonder how this is possible, what am I doing here different from others tags? I use this syntax in many others components and it works.
cc @ocombe
ocombe commentedon Mar 30, 2017
It's just that the digest function will take the name of the placeholder (and the content of the placeholder) into account when generating the id, which it obviously shouldn't because we only care about its position and the text around it
61 remaining items
petebacondarwin commentedon Oct 24, 2020
I believe this is fixed by the new ivy extraction. I will create some tests to check.
PowerKiKi commentedon Oct 25, 2020
I can confirm that I used to see duplicates in my project, but since my migration to Angular 10.1, this is no longer the case 🎉
petebacondarwin commentedon Oct 25, 2020
Thanks for the update @PowerKiKi
angular-automatic-lock-bot commentedon Nov 25, 2020
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.