Skip to content

i18n translation duplicated #15573

@elvisbegovic

Description

@elvisbegovic

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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions