| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import {Xliff2} from '@angular/compiler/src/i18n/serializers/xliff2'; | 
					
						
							| 
									
										
										
										
											2020-08-01 04:43:18 +09:00
										 |  |  | import {waitForAsync} from '@angular/core/testing'; | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  | import {expect} from '@angular/platform-browser/testing/src/matchers'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  | import {configureCompiler, createComponent, HTML, serializeTranslations, validateHtml} from './integration_common'; | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  | describe('i18n XLIFF integration spec', () => { | 
					
						
							|  |  |  |   describe('(with LF line endings)', () => { | 
					
						
							| 
									
										
										
										
											2020-08-01 04:43:18 +09:00
										 |  |  |     beforeEach(waitForAsync( | 
					
						
							|  |  |  |         () => configureCompiler(XLIFF2_TOMERGE + LF_LINE_ENDING_XLIFF2_TOMERGE, 'xlf2'))); | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     it('should extract from templates', () => { | 
					
						
							|  |  |  |       const serializer = new Xliff2(); | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |       const serializedXliff2 = serializeTranslations(HTML, serializer); | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |       XLIFF2_EXTRACTED.forEach(x => { | 
					
						
							|  |  |  |         expect(serializedXliff2).toContain(x); | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |       expect(serializedXliff2).toContain(LF_LINE_ENDING_XLIFF2_EXTRACTED); | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     it('should translate templates', () => { | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |       const {tb, cmp, el} = createComponent(HTML); | 
					
						
							|  |  |  |       validateHtml(tb, cmp, el); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   describe('(with CRLF line endings', () => { | 
					
						
							| 
									
										
										
										
											2020-08-01 04:43:18 +09:00
										 |  |  |     beforeEach(waitForAsync( | 
					
						
							|  |  |  |         () => configureCompiler(XLIFF2_TOMERGE + CRLF_LINE_ENDING_XLIFF2_TOMERGE, 'xlf2'))); | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  |     it('should extract from templates (with CRLF line endings)', () => { | 
					
						
							|  |  |  |       const serializer = new Xliff2(); | 
					
						
							|  |  |  |       const serializedXliff = serializeTranslations(HTML.replace(/\n/g, '\r\n'), serializer); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       XLIFF2_EXTRACTED.forEach(x => { | 
					
						
							|  |  |  |         expect(serializedXliff).toContain(x); | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |       expect(serializedXliff).toContain(CRLF_LINE_ENDING_XLIFF2_EXTRACTED); | 
					
						
							|  |  |  |     }); | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     it('should translate templates (with CRLF line endings)', () => { | 
					
						
							|  |  |  |       const {tb, cmp, el} = createComponent(HTML.replace(/\n/g, '\r\n')); | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       validateHtml(tb, cmp, el); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  | }); | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | const XLIFF2_TOMERGE = `
 | 
					
						
							|  |  |  |       <unit id="615790887472569365"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>i18n attribute on tags</source> | 
					
						
							|  |  |  |         <target>attributs i18n sur les balises</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="3707494640264351337"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>nested</source> | 
					
						
							|  |  |  |         <target>imbriqué</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="5539162898278769904"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>nested</source> | 
					
						
							|  |  |  |         <target>imbriqué</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="3780349238193953556"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><pc id="0" equivStart="START_ITALIC_TEXT" equivEnd="CLOSE_ITALIC_TEXT" type="fmt" dispStart="<i>" dispEnd="</i>">with placeholders</pc></source> | 
					
						
							|  |  |  |         <target><pc id="0" equivStart="START_ITALIC_TEXT" equivEnd="CLOSE_ITALIC_TEXT" type="fmt" dispStart="<i>" dispEnd="</i>">avec des espaces réservés</pc></target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="5415448997399451992"> | 
					
						
							|  |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:11</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><pc id="0" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>">with <pc id="1" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>">nested</pc> placeholders</pc></source> | 
					
						
							|  |  |  |         <target><pc id="0" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>">avec <pc id="1" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>">espaces réservés</pc> imbriqués</pc></target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="5525133077318024839"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>on not translatable node</source> | 
					
						
							|  |  |  |         <target>sur des balises non traductibles</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							| 
									
										
										
										
											2018-03-28 22:10:08 -07:00
										 |  |  |     <unit id="2174788525135228764"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><b>bold</b></source> | 
					
						
							|  |  |  |         <target><b>gras</b></target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     <unit id="8670732454866344690"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>on translatable node</source> | 
					
						
							|  |  |  |         <target>sur des balises traductibles</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="4593805537723189714"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <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> | 
					
						
							|  |  |  |         <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> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |     <unit id="703464324060964421"> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <segment> | 
					
						
							|  |  |  |         <source> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <ph id="0" equiv="ICU" disp="{sex, select, other {...} male {...} female {...}}"/> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     </source> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <target><ph id="0" equiv="ICU" disp="{sex, select, other {...} male {...} female {...}}"/></target> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |     <unit id="5430374139308914421"> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:23</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <source>{VAR_SELECT, select, other {other} male {m} female {female} }</source> | 
					
						
							|  |  |  |         <target>{VAR_SELECT, select, other {autre} male {homme} female {femme} }</target> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |     <unit id="1300564767229037107"> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:25,27</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <ph id="0" equiv="ICU" disp="{sexB, select, male {...} female {...}}"/> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     </source> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |       <target><ph id="0" equiv="ICU" disp="{sexB, select, male {...} female {...}}"/></target> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |     <unit id="2500580913783245106"> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <segment> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <source>{VAR_SELECT, select, male {m} female {f} }</source> | 
					
						
							|  |  |  |         <target>{VAR_SELECT, select, male {homme} female {femme} }</target> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="4851788426695310455"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><ph id="0" equiv="INTERPOLATION" disp="{{ "count = " + count }}"/></source> | 
					
						
							|  |  |  |         <target><ph id="0" equiv="INTERPOLATION" disp="{{ "count = " + count }}"/></target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="9013357158046221374"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>sex = <ph id="0" equiv="INTERPOLATION" disp="{{ sex }}"/></source> | 
					
						
							|  |  |  |         <target>sexe = <ph id="0" equiv="INTERPOLATION" disp="{{ sex }}"/></target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="8324617391167353662"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><ph id="0" equiv="CUSTOM_NAME" disp="{{ "custom name" //i18n(ph="CUSTOM_NAME") }}"/></source> | 
					
						
							|  |  |  |         <target><ph id="0" equiv="CUSTOM_NAME" disp="{{ "custom name" //i18n(ph="CUSTOM_NAME") }}"/></target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="7685649297917455806"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>in a translatable section</source> | 
					
						
							|  |  |  |         <target>dans une section traductible</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |     <unit id="2329001734457059408"> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <segment> | 
					
						
							|  |  |  |         <source> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |     <pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Markers in html comments</pc> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     <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> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |     <pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Balises dans les commentaires html</pc> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     <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> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="1491627405349178954"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>it <pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="<b>" dispEnd="</b>">should</pc> work</source> | 
					
						
							|  |  |  |         <target>ca <pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="<b>" dispEnd="</b>">devrait</pc> marcher</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="i18n16"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>with an explicit ID</source> | 
					
						
							|  |  |  |         <target>avec un ID explicite</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="i18n17"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <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> | 
					
						
							|  |  |  |         <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="4035252431381981115"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>foo<pc id="0" equivStart="START_LINK" equivEnd="CLOSE_LINK" type="link" dispStart="<a>" dispEnd="</a>">bar</pc></source> | 
					
						
							|  |  |  |         <target>FOO<pc id="0" equivStart="START_LINK" equivEnd="CLOSE_LINK" type="link" dispStart="<a>" dispEnd="</a>">BAR</pc></target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  |     <unit id="5339604010413301604"> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><ph id="0" equiv="MAP NAME" disp="{{ 'test' //i18n(ph="map name") }}"/></source> | 
					
						
							|  |  |  |         <target><ph id="0" equiv="MAP NAME" disp="{{ 'test' //i18n(ph="map name") }}"/></target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit>`;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  | const LF_LINE_ENDING_XLIFF2_TOMERGE = `    <unit id="4085484936881858615">
 | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>{VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found <ph id="0" equiv="INTERPOLATION" disp="{{response.getItemsList().length}}"/> results} }</source> | 
					
						
							|  |  |  |         <target>{VAR_PLURAL, plural, =0 {Pas de réponse} =1 {Une réponse} other {<ph id="0" equiv="INTERPOLATION" disp="{{response.getItemsList().length}}"/> réponses} }</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  | `;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const CRLF_LINE_ENDING_XLIFF2_TOMERGE = `    <unit id="4085484936881858615">
 | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>{VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found <ph id="0" equiv="INTERPOLATION" disp="{{response.getItemsList().length}}"/> results} }</source> | 
					
						
							|  |  |  |         <target>{VAR_PLURAL, plural, =0 {Pas de réponse} =1 {Une réponse} other {<ph id="0" equiv="INTERPOLATION" disp="{{response.getItemsList().length}}"/> réponses} }</target> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit> | 
					
						
							|  |  |  | `;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const XLIFF2_EXTRACTED = [ | 
					
						
							|  |  |  |   `    <unit id="615790887472569365">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:3</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>i18n attribute on tags</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="3707494640264351337">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:5</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>nested</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="5539162898278769904">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="meaning">different meaning</note> | 
					
						
							|  |  |  |         <note category="location">file.ts:7</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>nested</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="3780349238193953556">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:9</note> | 
					
						
							|  |  |  |         <note category="location">file.ts:10</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><pc id="0" equivStart="START_ITALIC_TEXT" equivEnd="CLOSE_ITALIC_TEXT" type="fmt" dispStart="<i>" dispEnd="</i>">with placeholders</pc></source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="5415448997399451992">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:11</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><pc id="0" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>">with <pc id="1" equivStart="START_TAG_DIV" equivEnd="CLOSE_TAG_DIV" type="other" dispStart="<div>" dispEnd="</div>">nested</pc> placeholders</pc></source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="5525133077318024839">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:14</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>on not translatable node</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="2174788525135228764">
 | 
					
						
							| 
									
										
										
										
											2018-03-28 22:10:08 -07:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:14</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><b>bold</b></source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="8670732454866344690">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:15</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>on translatable node</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="4593805537723189714">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:20</note> | 
					
						
							|  |  |  |         <note category="location">file.ts:37</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <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> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="703464324060964421">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:22,24</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <ph id="0" equiv="ICU" disp="{sex, select, male {...} female {...} other {...}}"/> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     </source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="5430374139308914421">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:23</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <source>{VAR_SELECT, select, male {m} female {f} other {other} }</source> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="1300564767229037107">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:25,27</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <ph id="0" equiv="ICU" disp="{sexB, select, male {...} female {...}}"/> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     </source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="2500580913783245106">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:26</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |         <source>{VAR_SELECT, select, male {m} female {f} }</source> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="4851788426695310455">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:29</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><ph id="0" equiv="INTERPOLATION" disp="{{ "count = " + count }}"/></source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="9013357158046221374">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:30</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>sex = <ph id="0" equiv="INTERPOLATION" disp="{{ sex }}"/></source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="8324617391167353662">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:31</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><ph id="0" equiv="CUSTOM_NAME" disp="{{ "custom name" //i18n(ph="CUSTOM_NAME") }}"/></source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="7685649297917455806">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:36</note> | 
					
						
							|  |  |  |         <note category="location">file.ts:54</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>in a translatable section</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="2329001734457059408">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:34,38</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source> | 
					
						
							| 
									
										
										
										
											2018-01-22 12:23:10 -08:00
										 |  |  |     <pc id="0" equivStart="START_HEADING_LEVEL1" equivEnd="CLOSE_HEADING_LEVEL1" type="other" dispStart="<h1>" dispEnd="</h1>">Markers in html comments</pc> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     <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> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="1491627405349178954">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:40</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>it <pc id="0" equivStart="START_BOLD_TEXT" equivEnd="CLOSE_BOLD_TEXT" type="fmt" dispStart="<b>" dispEnd="</b>">should</pc> work</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="i18n16">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:42</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>with an explicit ID</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="i18n17">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:43</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <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> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="4035252431381981115">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:54</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>foo<pc id="0" equivStart="START_LINK" equivEnd="CLOSE_LINK" type="link" dispStart="<a>" dispEnd="</a>">bar</pc></source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`,
 | 
					
						
							|  |  |  |   `    <unit id="5339604010413301604">
 | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="location">file.ts:56</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source><ph id="0" equiv="MAP NAME" disp="{{ 'test' //i18n(ph="map name") }}"/></source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2020-04-27 12:20:17 +01:00
										 |  |  |     </unit>`
 | 
					
						
							|  |  |  | ]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const LF_LINE_ENDING_XLIFF2_EXTRACTED = `    <unit id="4085484936881858615">
 | 
					
						
							|  |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="description">desc</note> | 
					
						
							|  |  |  |         <note category="location">file.ts:46,52</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>{VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found <ph id="0" equiv="INTERPOLATION" disp="{{response.getItemsList().length}}"/> results} }</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							|  |  |  |     </unit>`;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const CRLF_LINE_ENDING_XLIFF2_EXTRACTED = `    <unit id="4085484936881858615">
 | 
					
						
							|  |  |  |       <notes> | 
					
						
							|  |  |  |         <note category="description">desc</note> | 
					
						
							|  |  |  |         <note category="location">file.ts:46,52</note> | 
					
						
							|  |  |  |       </notes> | 
					
						
							|  |  |  |       <segment> | 
					
						
							|  |  |  |         <source>{VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found <ph id="0" equiv="INTERPOLATION" disp="{{response.getItemsList().length}}"/> results} }</source> | 
					
						
							|  |  |  |       </segment> | 
					
						
							| 
									
										
										
										
											2017-07-21 19:49:45 +02:00
										 |  |  |     </unit>`;
 |