0

I'm not able to translate dynamic text with spacing, see example below.

sample.ts

dynamicTexts = ['Date','Hello World']

sample.html

<span i18n="@@sample" *ngFor="let dynamicText of dynamicTexts">
    {dynamicText, select, other { {{ dynamicText }} } }
</span>

messages.xlf

<trans-unit id="sample" datatype="html">
    <source>{VAR_SELECT, select, other {<x id="INTERPOLATION" equiv-text="{{ dynamicText }}"/> } }</source>
    <target>{VAR_SELECT, select, Date {Translated Date} Hello World {Translated Hello World} other {<x id="INTERPOLATION" equiv-text="{{ dynamicText }}"/>} }</target>
</trans-unit>

sample.html current result

<span>
    Translated Date
</span>
<span>
    Hello World
</span>

sample.html expected result

<span>
    Translated Date
</span>
<span>
    Translated Hello World
</span>
  • I'm able to translate 'Date'(text without spacing) to 'Translated Date'
  • I'm not able to translate 'Hello World'(text with spacing) to 'Translated Hello World'

Please Help

nicker
  • 477
  • 2
  • 6
  • 20

0 Answers0