fix(compiler): fix ICU select messages to use male/female/other (#21713)
related to #21694 PR Close #21713
This commit is contained in:
parent
4b70bcd200
commit
cb5090cdc8
|
@ -71,12 +71,12 @@ export function validateHtml(
|
|||
expect(el.query(By.css('#i18n-14')).nativeElement).toHaveText('beaucoup');
|
||||
expect(el.query(By.css('#i18n-17')).nativeElement).toHaveText('beaucoup');
|
||||
|
||||
cmp.sex = 'm';
|
||||
cmp.sexB = 'f';
|
||||
cmp.sex = 'male';
|
||||
cmp.sexB = 'female';
|
||||
tb.detectChanges();
|
||||
expect(el.query(By.css('#i18n-8')).nativeElement).toHaveText('homme');
|
||||
expect(el.query(By.css('#i18n-8b')).nativeElement).toHaveText('femme');
|
||||
cmp.sex = 'f';
|
||||
cmp.sex = 'female';
|
||||
tb.detectChanges();
|
||||
expect(el.query(By.css('#i18n-8')).nativeElement).toHaveText('femme');
|
||||
cmp.sex = '0';
|
||||
|
@ -107,38 +107,38 @@ function expectHtml(el: DebugElement, cssSelector: string): any {
|
|||
export const HTML = `
|
||||
<div>
|
||||
<h1 i18n>i18n attribute on tags</h1>
|
||||
|
||||
|
||||
<div id="i18n-1"><p i18n>nested</p></div>
|
||||
|
||||
|
||||
<div id="i18n-2"><p i18n="different meaning|">nested</p></div>
|
||||
|
||||
|
||||
<div id="i18n-3"><p i18n><i>with placeholders</i></p></div>
|
||||
<div id="i18n-3b"><p i18n><i class="preserved-on-placeholders">with placeholders</i></p></div>
|
||||
<div id="i18n-3c"><div i18n><div>with <div>nested</div> placeholders</div></div></div>
|
||||
|
||||
|
||||
<div>
|
||||
<p id="i18n-4" i18n-title title="on not translatable node"></p>
|
||||
<p id="i18n-5" i18n i18n-title title="on translatable node"></p>
|
||||
<p id="i18n-6" i18n-title title></p>
|
||||
</div>
|
||||
|
||||
<!-- no ph below because the ICU node is the only child of the div, i.e. no text nodes -->
|
||||
|
||||
<!-- no ph below because the ICU node is the only child of the div, i.e. no text nodes -->
|
||||
<div i18n id="i18n-7">{count, plural, =0 {zero} =1 {one} =2 {two} other {<b>many</b>}}</div>
|
||||
|
||||
|
||||
<div i18n id="i18n-8">
|
||||
{sex, select, m {male} f {female} 0 {other}}
|
||||
{sex, select, male {m} female {f} other {other}}
|
||||
</div>
|
||||
<div i18n id="i18n-8b">
|
||||
{sexB, select, m {male} f {female}}
|
||||
{sexB, select, male {m} female {f}}
|
||||
</div>
|
||||
|
||||
|
||||
<div i18n id="i18n-9">{{ "count = " + count }}</div>
|
||||
<div i18n id="i18n-10">sex = {{ sex }}</div>
|
||||
<div i18n id="i18n-11">{{ "custom name" //i18n(ph="CUSTOM_NAME") }}</div>
|
||||
<div i18n id="i18n-11">{{ "custom name" //i18n(ph="CUSTOM_NAME") }}</div>
|
||||
</div>
|
||||
|
||||
<!-- i18n -->
|
||||
<h1 id="i18n-12" >Markers in html comments</h1>
|
||||
<h1 id="i18n-12" >Markers in html comments</h1>
|
||||
<div id="i18n-13" i18n-title title="in a translatable section"></div>
|
||||
<div id="i18n-14">{count, plural, =0 {zero} =1 {one} =2 {two} other {<b>many</b>}}</div>
|
||||
<!-- /i18n -->
|
||||
|
|
|
@ -107,38 +107,38 @@ const XLIFF2_TOMERGE = `
|
|||
<target>{VAR_PLURAL, plural, =0 {zero} =1 {un} =2 {deux} other {<pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="<b>" dispEnd="</b>">beaucoup</pc>} }</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="4360321700965841752">
|
||||
<unit id="703464324060964421">
|
||||
<segment>
|
||||
<source>
|
||||
<ph id="0" equiv="ICU" disp="{sex, select, 0 {...} m {...} f {...}}"/>
|
||||
<ph id="0" equiv="ICU" disp="{sex, select, other {...} male {...} female {...}}"/>
|
||||
</source>
|
||||
<target><ph id="0" equiv="ICU" disp="{sex, select, 0 {...} m {...} f {...}}"/></target>
|
||||
<target><ph id="0" equiv="ICU" disp="{sex, select, other {...} male {...} female {...}}"/></target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="5460933846928880074">
|
||||
<unit id="5430374139308914421">
|
||||
<notes>
|
||||
<note category="location">file.ts:23</note>
|
||||
</notes>
|
||||
<segment>
|
||||
<source>{VAR_SELECT, select, 0 {other} m {male} f {female} }</source>
|
||||
<target>{VAR_SELECT, select, 0 {autre} m {homme} f {femme} }</target>
|
||||
<source>{VAR_SELECT, select, other {other} male {m} female {female} }</source>
|
||||
<target>{VAR_SELECT, select, other {autre} male {homme} female {femme} }</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="1746565782635215">
|
||||
<unit id="1300564767229037107">
|
||||
<notes>
|
||||
<note category="location">file.ts:25,27</note>
|
||||
</notes>
|
||||
<segment>
|
||||
<source>
|
||||
<ph id="0" equiv="ICU" disp="{sexB, select, m {...} f {...}}"/>
|
||||
<ph id="0" equiv="ICU" disp="{sexB, select, male {...} female {...}}"/>
|
||||
</source>
|
||||
<target><ph id="0" equiv="ICU" disp="{sexB, select, m {...} f {...}}"/></target>
|
||||
<target><ph id="0" equiv="ICU" disp="{sexB, select, male {...} female {...}}"/></target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="5868084092545682515">
|
||||
<unit id="2500580913783245106">
|
||||
<segment>
|
||||
<source>{VAR_SELECT, select, m {male} f {female} }</source>
|
||||
<target>{VAR_SELECT, select, m {homme} f {femme} }</target>
|
||||
<source>{VAR_SELECT, select, male {m} female {f} }</source>
|
||||
<target>{VAR_SELECT, select, male {homme} female {femme} }</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="4851788426695310455">
|
||||
|
@ -165,15 +165,15 @@ const XLIFF2_TOMERGE = `
|
|||
<target>dans une section traductible</target>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="2387287228265107305">
|
||||
<unit id="2329001734457059408">
|
||||
<segment>
|
||||
<source>
|
||||
<pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Markers in html comments</pc>
|
||||
<pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Markers in html comments</pc>
|
||||
<pc id="1" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>"></pc>
|
||||
<pc id="2" equivStart="START_TAG_DIV_1" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>"><ph id="3" equiv="ICU" disp="{count, plural, =0 {...} =1 {...} =2 {...} other {...}}"/></pc>
|
||||
</source>
|
||||
<target>
|
||||
<pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Balises dans les commentaires html</pc>
|
||||
<pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Balises dans les commentaires html</pc>
|
||||
<pc id="1" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>"></pc>
|
||||
<pc id="2" equivStart="START_TAG_DIV_1" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>"><ph id="3" equiv="ICU" disp="{count, plural, =0 {...} =1 {...} =2 {...} other {...}}"/></pc>
|
||||
</target>
|
||||
|
@ -284,40 +284,40 @@ const XLIFF2_EXTRACTED = `
|
|||
<source>{VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {<pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="<b>" dispEnd="</b>">many</pc>} }</source>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="4360321700965841752">
|
||||
<unit id="703464324060964421">
|
||||
<notes>
|
||||
<note category="location">file.ts:22,24</note>
|
||||
</notes>
|
||||
<segment>
|
||||
<source>
|
||||
<ph id="0" equiv="ICU" disp="{sex, select, 0 {...} m {...} f {...}}"/>
|
||||
<ph id="0" equiv="ICU" disp="{sex, select, male {...} female {...} other {...}}"/>
|
||||
</source>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="5460933846928880074">
|
||||
<unit id="5430374139308914421">
|
||||
<notes>
|
||||
<note category="location">file.ts:23</note>
|
||||
</notes>
|
||||
<segment>
|
||||
<source>{VAR_SELECT, select, 0 {other} m {male} f {female} }</source>
|
||||
<source>{VAR_SELECT, select, male {m} female {f} other {other} }</source>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="1746565782635215">
|
||||
<unit id="1300564767229037107">
|
||||
<notes>
|
||||
<note category="location">file.ts:25,27</note>
|
||||
</notes>
|
||||
<segment>
|
||||
<source>
|
||||
<ph id="0" equiv="ICU" disp="{sexB, select, m {...} f {...}}"/>
|
||||
<ph id="0" equiv="ICU" disp="{sexB, select, male {...} female {...}}"/>
|
||||
</source>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="5868084092545682515">
|
||||
<unit id="2500580913783245106">
|
||||
<notes>
|
||||
<note category="location">file.ts:26</note>
|
||||
</notes>
|
||||
<segment>
|
||||
<source>{VAR_SELECT, select, m {male} f {female} }</source>
|
||||
<source>{VAR_SELECT, select, male {m} female {f} }</source>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="4851788426695310455">
|
||||
|
@ -353,13 +353,13 @@ const XLIFF2_EXTRACTED = `
|
|||
<source>in a translatable section</source>
|
||||
</segment>
|
||||
</unit>
|
||||
<unit id="2387287228265107305">
|
||||
<unit id="2329001734457059408">
|
||||
<notes>
|
||||
<note category="location">file.ts:34,38</note>
|
||||
</notes>
|
||||
<segment>
|
||||
<source>
|
||||
<pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Markers in html comments</pc>
|
||||
<pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Markers in html comments</pc>
|
||||
<pc id="1" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>"></pc>
|
||||
<pc id="2" equivStart="START_TAG_DIV_1" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>"><ph id="3" equiv="ICU" disp="{count, plural, =0 {...} =1 {...} =2 {...} other {...}}"/></pc>
|
||||
</source>
|
||||
|
|
|
@ -93,25 +93,25 @@ const XLIFF_TOMERGE = `
|
|||
<source>{VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {<x id="START_BOLD_TEXT" ctype="x-b" equiv-text="<b>"/>many<x id="CLOSE_BOLD_TEXT" ctype="x-b" equiv-text="</b>"/>} }</source>
|
||||
<target>{VAR_PLURAL, plural, =0 {zero} =1 {un} =2 {deux} other {<x id="START_BOLD_TEXT" ctype="x-b"/>beaucoup<x id="CLOSE_BOLD_TEXT" ctype="x-b"/>} }</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="ba9106fca6e4e33a9b703a8c1927e2d1794dd9ff" datatype="html">
|
||||
<trans-unit id="49feb201083cbd2c8bfc48a4ae11f105fb984876" datatype="html">
|
||||
<source>
|
||||
<x id="ICU" equiv-text="{sex, select, m {...} f {...}}"/>
|
||||
<x id="ICU" equiv-text="{sex, select, male {...} female {...}}"/>
|
||||
</source>
|
||||
<target><x id="ICU"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="7b7916d063ebaafcd2e9dcdf697b5e184fcb8099" datatype="html">
|
||||
<source>{VAR_SELECT, select, 0 {other} m {male} f {female} }</source>
|
||||
<target>{VAR_SELECT, select, 0 {autre} m {homme} f {femme}}</target>
|
||||
<trans-unit id="f3be30eb9a18f6e336cc3ca4dd66bbc3a35c5f97" datatype="html">
|
||||
<source>{VAR_SELECT, select, other {other} male {m} female {f} }</source>
|
||||
<target>{VAR_SELECT, select, other {autre} male {homme} female {femme}}</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="078b7089573c5f66a2f78dce0adaa55e6715beb1" datatype="html">
|
||||
<trans-unit id="cc16e9745fa0b95b2ebc2f18b47ed8e64fe5f0f9" datatype="html">
|
||||
<source>
|
||||
<x id="ICU" equiv-text="{sexB, select, m {...} f {...}}"/>
|
||||
</source>
|
||||
<target><x id="ICU"/></target>
|
||||
</trans-unit>
|
||||
<trans-unit id="a25cf2e21a299f30be1392e731163825233edc61" datatype="html">
|
||||
<source>{VAR_SELECT, select, m {male} f {female} }</source>
|
||||
<target>{VAR_SELECT, select, m {homme} f {femme} }</target>
|
||||
<trans-unit id="4573f2edb0329d69afc2ab8c73c71e2f8b08f807" datatype="html">
|
||||
<source>{VAR_SELECT, select, male {m} female {f} }</source>
|
||||
<target>{VAR_SELECT, select, male {homme} female {femme} }</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="d9879678f727b244bc7c7e20f22b63d98cb14890" datatype="html">
|
||||
<source><x id="INTERPOLATION" equiv-text="{{ "count = " + count }}"/></source>
|
||||
|
@ -129,9 +129,9 @@ const XLIFF_TOMERGE = `
|
|||
<source>in a translatable section</source>
|
||||
<target>dans une section traductible</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="eee74a5be8a75881a4785905bd8302a71f7d9f75" datatype="html">
|
||||
<trans-unit id="7f6272480ea8e7ffab548da885ab8105ee2caa93" datatype="html">
|
||||
<source>
|
||||
<x id="START_HEADING_LEVEL1" ctype="x-h1" equiv-text="<h1>"/>Markers in html comments<x id="CLOSE_HEADING_LEVEL1" ctype="x-h1" equiv-text="</h1>"/>
|
||||
<x id="START_HEADING_LEVEL1" ctype="x-h1" equiv-text="<h1>"/>Markers in html comments<x id="CLOSE_HEADING_LEVEL1" ctype="x-h1" equiv-text="</h1>"/>
|
||||
<x id="START_TAG_DIV" ctype="x-div" equiv-text="<div>"/><x id="CLOSE_TAG_DIV" ctype="x-div" equiv-text="</div>"/>
|
||||
<x id="START_TAG_DIV_1" ctype="x-div" equiv-text="<div>"/><x id="ICU" equiv-text="{count, plural, =0 {...} =1 {...} =2 {...} other {...}}"/><x id="CLOSE_TAG_DIV" ctype="x-div" equiv-text="</div>"/>
|
||||
</source>
|
||||
|
@ -233,33 +233,33 @@ const XLIFF_EXTRACTED = `
|
|||
<context context-type="linenumber">37</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="ba9106fca6e4e33a9b703a8c1927e2d1794dd9ff" datatype="html">
|
||||
<trans-unit id="49feb201083cbd2c8bfc48a4ae11f105fb984876" datatype="html">
|
||||
<source>
|
||||
<x id="ICU" equiv-text="{sex, select, 0 {...} m {...} f {...}}"/>
|
||||
<x id="ICU" equiv-text="{sex, select, male {...} female {...} other {...}}"/>
|
||||
</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">file.ts</context>
|
||||
<context context-type="linenumber">22</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="7b7916d063ebaafcd2e9dcdf697b5e184fcb8099" datatype="html">
|
||||
<source>{VAR_SELECT, select, 0 {other} m {male} f {female} }</source>
|
||||
<trans-unit id="f3be30eb9a18f6e336cc3ca4dd66bbc3a35c5f97" datatype="html">
|
||||
<source>{VAR_SELECT, select, male {m} female {f} other {other} }</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">file.ts</context>
|
||||
<context context-type="linenumber">23</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="078b7089573c5f66a2f78dce0adaa55e6715beb1" datatype="html">
|
||||
<trans-unit id="cc16e9745fa0b95b2ebc2f18b47ed8e64fe5f0f9" datatype="html">
|
||||
<source>
|
||||
<x id="ICU" equiv-text="{sexB, select, m {...} f {...}}"/>
|
||||
<x id="ICU" equiv-text="{sexB, select, male {...} female {...}}"/>
|
||||
</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">file.ts</context>
|
||||
<context context-type="linenumber">25</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="a25cf2e21a299f30be1392e731163825233edc61" datatype="html">
|
||||
<source>{VAR_SELECT, select, m {male} f {female} }</source>
|
||||
<trans-unit id="4573f2edb0329d69afc2ab8c73c71e2f8b08f807" datatype="html">
|
||||
<source>{VAR_SELECT, select, male {m} female {f} }</source>
|
||||
<context-group purpose="location">
|
||||
<context context-type="sourcefile">file.ts</context>
|
||||
<context context-type="linenumber">26</context>
|
||||
|
@ -297,9 +297,9 @@ const XLIFF_EXTRACTED = `
|
|||
<context context-type="linenumber">54</context>
|
||||
</context-group>
|
||||
</trans-unit>
|
||||
<trans-unit id="eee74a5be8a75881a4785905bd8302a71f7d9f75" datatype="html">
|
||||
<trans-unit id="7f6272480ea8e7ffab548da885ab8105ee2caa93" datatype="html">
|
||||
<source>
|
||||
<x id="START_HEADING_LEVEL1" ctype="x-h1" equiv-text="<h1>"/>Markers in html comments<x id="CLOSE_HEADING_LEVEL1" ctype="x-h1" equiv-text="</h1>"/>
|
||||
<x id="START_HEADING_LEVEL1" ctype="x-h1" equiv-text="<h1>"/>Markers in html comments<x id="CLOSE_HEADING_LEVEL1" ctype="x-h1" equiv-text="</h1>"/>
|
||||
<x id="START_TAG_DIV" ctype="x-div" equiv-text="<div>"/><x id="CLOSE_TAG_DIV" ctype="x-div" equiv-text="</div>"/>
|
||||
<x id="START_TAG_DIV_1" ctype="x-div" equiv-text="<div>"/><x id="ICU" equiv-text="{count, plural, =0 {...} =1 {...} =2 {...} other {...}}"/><x id="CLOSE_TAG_DIV" ctype="x-div" equiv-text="</div>"/>
|
||||
</source>
|
||||
|
|
|
@ -65,22 +65,22 @@ const XTB = `
|
|||
<translation id="5525133077318024839">sur des balises non traductibles</translation>
|
||||
<translation id="8670732454866344690">sur des balises traductibles</translation>
|
||||
<translation id="4593805537723189714">{VAR_PLURAL, plural, =0 {zero} =1 {un} =2 {deux} other {<ph name="START_BOLD_TEXT"/>beaucoup<ph name="CLOSE_BOLD_TEXT"/>}}</translation>
|
||||
<translation id="4360321700965841752"><ph name="ICU"/></translation>
|
||||
<translation id="5460933846928880074">{VAR_SELECT, select, 0 {autre} m {homme} f {femme} }</translation>
|
||||
<translation id="1746565782635215"><ph name="ICU"/></translation>
|
||||
<translation id="5868084092545682515">{VAR_SELECT, select, m {homme} f {femme}}</translation>
|
||||
<translation id="703464324060964421"><ph name="ICU"/></translation>
|
||||
<translation id="5430374139308914421">{VAR_SELECT, select, male {homme} female {femme} other {autre}}</translation>
|
||||
<translation id="1300564767229037107"><ph name="ICU"/></translation>
|
||||
<translation id="2500580913783245106">{VAR_SELECT, select, male {homme} female {femme}}</translation>
|
||||
<translation id="4851788426695310455"><ph name="INTERPOLATION"/></translation>
|
||||
<translation id="9013357158046221374">sexe = <ph name="INTERPOLATION"/></translation>
|
||||
<translation id="8324617391167353662"><ph name="CUSTOM_NAME"/></translation>
|
||||
<translation id="7685649297917455806">dans une section traductible</translation>
|
||||
<translation id="2387287228265107305">
|
||||
<ph name="START_HEADING_LEVEL1"/>Balises dans les commentaires html<ph name="CLOSE_HEADING_LEVEL1"/>
|
||||
<translation id="2329001734457059408">
|
||||
<ph name="START_HEADING_LEVEL1"/>Balises dans les commentaires html<ph name="CLOSE_HEADING_LEVEL1"/>
|
||||
<ph name="START_TAG_DIV"/><ph name="CLOSE_TAG_DIV"/>
|
||||
<ph name="START_TAG_DIV_1"/><ph name="ICU"/><ph name="CLOSE_TAG_DIV"></ph>
|
||||
</translation>
|
||||
<translation id="1491627405349178954">ca <ph name="START_BOLD_TEXT"/>devrait<ph name="CLOSE_BOLD_TEXT"/> marcher</translation>
|
||||
<translation id="i18n16">avec un ID explicite</translation>
|
||||
<translation id="i18n17">{VAR_PLURAL, plural, =0 {zero} =1 {un} =2 {deux} other {<ph
|
||||
<translation id="i18n17">{VAR_PLURAL, plural, =0 {zero} =1 {un} =2 {deux} other {<ph
|
||||
name="START_BOLD_TEXT"><ex><b></ex></ph>beaucoup<ph name="CLOSE_BOLD_TEXT"><ex></b></ex></ph>} }</translation>
|
||||
<translation id="4085484936881858615">{VAR_PLURAL, plural, =0 {Pas de réponse} =1 {une réponse} other {<ph name="INTERPOLATION"><ex>INTERPOLATION</ex></ph> réponse} }</translation>
|
||||
<translation id="4035252431381981115">FOO<ph name="START_LINK"><ex><a></ex></ph>BAR<ph name="CLOSE_LINK"><ex></a></ex></ph></translation>
|
||||
|
@ -95,20 +95,20 @@ const XMB = `<msg id="615790887472569365"><source>file.ts:3</source>i18n attribu
|
|||
<msg id="5525133077318024839"><source>file.ts:14</source>on not translatable node</msg>
|
||||
<msg id="8670732454866344690"><source>file.ts:15</source>on translatable node</msg>
|
||||
<msg id="4593805537723189714"><source>file.ts:20</source><source>file.ts:37</source>{VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {<ph name="START_BOLD_TEXT"><ex><b></ex></ph>many<ph name="CLOSE_BOLD_TEXT"><ex></b></ex></ph>} }</msg>
|
||||
<msg id="4360321700965841752"><source>file.ts:22,24</source>
|
||||
<ph name="ICU"><ex>{sex, select, 0 {...} m {...} f {...}}</ex></ph>
|
||||
<msg id="703464324060964421"><source>file.ts:22,24</source>
|
||||
<ph name="ICU"><ex>{sex, select, male {...} female {...} other {...}}</ex></ph>
|
||||
</msg>
|
||||
<msg id="5460933846928880074"><source>file.ts:23</source>{VAR_SELECT, select, 0 {other} m {male} f {female} }</msg>
|
||||
<msg id="1746565782635215"><source>file.ts:25,27</source>
|
||||
<ph name="ICU"><ex>{sexB, select, m {...} f {...}}</ex></ph>
|
||||
<msg id="5430374139308914421"><source>file.ts:23</source>{VAR_SELECT, select, male {m} female {f} other {other} }</msg>
|
||||
<msg id="1300564767229037107"><source>file.ts:25,27</source>
|
||||
<ph name="ICU"><ex>{sexB, select, male {...} female {...}}</ex></ph>
|
||||
</msg>
|
||||
<msg id="5868084092545682515"><source>file.ts:26</source>{VAR_SELECT, select, m {male} f {female} }</msg>
|
||||
<msg id="2500580913783245106"><source>file.ts:26</source>{VAR_SELECT, select, male {m} female {f} }</msg>
|
||||
<msg id="4851788426695310455"><source>file.ts:29</source><ph name="INTERPOLATION"><ex>{{ "count = " + count }}</ex></ph></msg>
|
||||
<msg id="9013357158046221374"><source>file.ts:30</source>sex = <ph name="INTERPOLATION"><ex>{{ sex }}</ex></ph></msg>
|
||||
<msg id="8324617391167353662"><source>file.ts:31</source><ph name="CUSTOM_NAME"><ex>{{ "custom name" //i18n(ph="CUSTOM_NAME") }}</ex></ph></msg>
|
||||
<msg id="7685649297917455806"><source>file.ts:36</source><source>file.ts:54</source>in a translatable section</msg>
|
||||
<msg id="2387287228265107305"><source>file.ts:34,38</source>
|
||||
<ph name="START_HEADING_LEVEL1"><ex><h1></ex></ph>Markers in html comments<ph name="CLOSE_HEADING_LEVEL1"><ex></h1></ex></ph>
|
||||
<msg id="2329001734457059408"><source>file.ts:34,38</source>
|
||||
<ph name="START_HEADING_LEVEL1"><ex><h1></ex></ph>Markers in html comments<ph name="CLOSE_HEADING_LEVEL1"><ex></h1></ex></ph>
|
||||
<ph name="START_TAG_DIV"><ex><div></ex></ph><ph name="CLOSE_TAG_DIV"><ex></div></ex></ph>
|
||||
<ph name="START_TAG_DIV_1"><ex><div></ex></ph><ph name="ICU"><ex>{count, plural, =0 {...} =1 {...} =2 {...} other {...}}</ex></ph><ph name="CLOSE_TAG_DIV"><ex></div></ex></ph>
|
||||
</msg>
|
||||
|
|
|
@ -36,7 +36,7 @@ import {humanizeNodes} from './ast_spec_utils';
|
|||
});
|
||||
|
||||
it('should handle nested expansion forms', () => {
|
||||
const res = expand(`{messages.length, plural, =0 { {p.gender, select, =m {m}} }}`);
|
||||
const res = expand(`{messages.length, plural, =0 { {p.gender, select, male {m}} }}`);
|
||||
|
||||
expect(humanizeNodes(res.nodes)).toEqual([
|
||||
[html.Element, 'ng-container', 0],
|
||||
|
@ -46,7 +46,7 @@ import {humanizeNodes} from './ast_spec_utils';
|
|||
[html.Element, 'ng-container', 2],
|
||||
[html.Attribute, '[ngSwitch]', 'p.gender'],
|
||||
[html.Element, 'ng-template', 3],
|
||||
[html.Attribute, 'ngSwitchCase', '=m'],
|
||||
[html.Attribute, 'ngSwitchCase', 'male'],
|
||||
[html.Text, 'm', 4],
|
||||
[html.Text, ' ', 2],
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue