diff --git a/packages/compiler/test/i18n/integration_common.ts b/packages/compiler/test/i18n/integration_common.ts index ac8cdf590d..4e1f84ae95 100644 --- a/packages/compiler/test/i18n/integration_common.ts +++ b/packages/compiler/test/i18n/integration_common.ts @@ -7,13 +7,18 @@ */ import {NgLocalization} from '@angular/common'; -import {Component, DebugElement} from '@angular/core'; -import {ComponentFixture} from '@angular/core/testing'; - +import {Serializer} from '@angular/compiler/src/i18n'; +import {MessageBundle} from '@angular/compiler/src/i18n/message_bundle'; +import {HtmlParser} from '@angular/compiler/src/ml_parser/html_parser'; +import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/ml_parser/interpolation_config'; +import {Component, DebugElement, TRANSLATIONS, TRANSLATIONS_FORMAT} from '@angular/core'; +import {ComponentFixture, TestBed} from '@angular/core/testing'; import {By} from '@angular/platform-browser/src/dom/debug/by'; import {stringifyElement} from '@angular/platform-browser/testing/src/browser_util'; import {expect} from '@angular/platform-browser/testing/src/matchers'; +import {SpyResourceLoader} from '../spies'; + @Component({ selector: 'i18n-cmp', template: '', @@ -97,6 +102,15 @@ export function validateHtml( expectHtml(el, '#i18n-13').toBe('
'); expectHtml(el, '#i18n-15').toMatch(/ca devrait<\/b> marcher/); expectHtml(el, '#i18n-16').toMatch(/avec un ID explicite/); + + expectHtml(el, '#i18n-17-5').toContain('Pas de réponse'); + cmp.response.getItemsList = () => ['a']; + tb.detectChanges(); + expectHtml(el, '#i18n-17-5').toContain('Une réponse'); + cmp.response.getItemsList = () => ['a', 'b']; + tb.detectChanges(); + expectHtml(el, '#i18n-17-5').toContain('2 réponses'); + expectHtml(el, '#i18n-18') .toEqual('
FOOBAR
'); } @@ -150,7 +164,7 @@ export const HTML = `
{count, plural, =0 {zero} =1 {one} =2 {two} other {many}}
-
{ +
{ response.getItemsList().length, plural, =0 {Found no results} @@ -160,5 +174,29 @@ export const HTML = `
foobar
-
{{ 'test' //i18n(ph="map name") }}
+
{{ 'test' //i18n(ph="map name") }}
`; + +export async function configureCompiler(translationsToMerge: string, format: string) { + TestBed.configureCompiler({ + providers: [ + SpyResourceLoader.PROVIDE, + FrLocalization.PROVIDE, + {provide: TRANSLATIONS, useValue: translationsToMerge}, + {provide: TRANSLATIONS_FORMAT, useValue: format}, + ] + }); + TestBed.configureTestingModule({declarations: [I18nComponent]}); +} + +export function createComponent(html: string) { + const tb: ComponentFixture = + TestBed.overrideTemplate(I18nComponent, html).createComponent(I18nComponent); + return {tb, cmp: tb.componentInstance, el: tb.debugElement}; +} + +export function serializeTranslations(html: string, serializer: Serializer) { + const catalog = new MessageBundle(new HtmlParser, [], {}); + catalog.updateFromTemplate(html, 'file.ts', DEFAULT_INTERPOLATION_CONFIG); + return catalog.write(serializer); +} diff --git a/packages/compiler/test/i18n/integration_xliff2_spec.ts b/packages/compiler/test/i18n/integration_xliff2_spec.ts index 5feeca415c..f0ddecdb5f 100644 --- a/packages/compiler/test/i18n/integration_xliff2_spec.ts +++ b/packages/compiler/test/i18n/integration_xliff2_spec.ts @@ -6,53 +6,53 @@ * found in the LICENSE file at https://angular.io/license */ -import {NgLocalization} from '@angular/common'; -import {ResourceLoader} from '@angular/compiler'; -import {MessageBundle} from '@angular/compiler/src/i18n/message_bundle'; import {Xliff2} from '@angular/compiler/src/i18n/serializers/xliff2'; -import {HtmlParser} from '@angular/compiler/src/ml_parser/html_parser'; -import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/ml_parser/interpolation_config'; -import {DebugElement, TRANSLATIONS, TRANSLATIONS_FORMAT} from '@angular/core'; -import {async, ComponentFixture, TestBed} from '@angular/core/testing'; +import {async} from '@angular/core/testing'; import {expect} from '@angular/platform-browser/testing/src/matchers'; -import {SpyResourceLoader} from '../spies'; +import {configureCompiler, createComponent, HTML, serializeTranslations, validateHtml} from './integration_common'; -import {FrLocalization, HTML, I18nComponent, validateHtml} from './integration_common'; - -{ - describe('i18n XLIFF 2.0 integration spec', () => { - beforeEach(async(() => { - TestBed.configureCompiler({ - providers: [ - SpyResourceLoader.PROVIDE, - FrLocalization.PROVIDE, - {provide: TRANSLATIONS, useValue: XLIFF2_TOMERGE}, - {provide: TRANSLATIONS_FORMAT, useValue: 'xlf2'}, - ] - }); - - TestBed.configureTestingModule({declarations: [I18nComponent]}); - })); +describe('i18n XLIFF integration spec', () => { + describe('(with LF line endings)', () => { + beforeEach( + async(() => configureCompiler(XLIFF2_TOMERGE + LF_LINE_ENDING_XLIFF2_TOMERGE, 'xlf2'))); it('should extract from templates', () => { - const catalog = new MessageBundle(new HtmlParser, [], {}); const serializer = new Xliff2(); - catalog.updateFromTemplate(HTML, 'file.ts', DEFAULT_INTERPOLATION_CONFIG); + const serializedXliff2 = serializeTranslations(HTML, serializer); - expect(catalog.write(serializer)).toContain(XLIFF2_EXTRACTED); + XLIFF2_EXTRACTED.forEach(x => { + expect(serializedXliff2).toContain(x); + }); + expect(serializedXliff2).toContain(LF_LINE_ENDING_XLIFF2_EXTRACTED); }); it('should translate templates', () => { - const tb: ComponentFixture = - TestBed.overrideTemplate(I18nComponent, HTML).createComponent(I18nComponent); - const cmp: I18nComponent = tb.componentInstance; - const el: DebugElement = tb.debugElement; - + const {tb, cmp, el} = createComponent(HTML); validateHtml(tb, cmp, el); }); }); -} + + describe('(with CRLF line endings', () => { + beforeEach( + async(() => configureCompiler(XLIFF2_TOMERGE + CRLF_LINE_ENDING_XLIFF2_TOMERGE, 'xlf2'))); + + 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); + }); + + it('should translate templates (with CRLF line endings)', () => { + const {tb, cmp, el} = createComponent(HTML.replace(/\n/g, '\r\n')); + validateHtml(tb, cmp, el); + }); + }); +}); const XLIFF2_TOMERGE = ` @@ -202,12 +202,6 @@ const XLIFF2_TOMERGE = ` {VAR_PLURAL, plural, =0 {zero} =1 {un} =2 {deux} other {beaucoup} } - - - {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } - {VAR_PLURAL, plural, =0 {Pas de réponse} =1 {une réponse} other {Trouvé réponses} } - - foobar @@ -221,24 +215,40 @@ const XLIFF2_TOMERGE = ` `; -const XLIFF2_EXTRACTED = ` - +const LF_LINE_ENDING_XLIFF2_TOMERGE = ` + + {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } + {VAR_PLURAL, plural, =0 {Pas de réponse} =1 {Une réponse} other { réponses} } + + +`; + +const CRLF_LINE_ENDING_XLIFF2_TOMERGE = ` + + {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } + {VAR_PLURAL, plural, =0 {Pas de réponse} =1 {Une réponse} other { réponses} } + + +`; + +const XLIFF2_EXTRACTED = [ + ` file.ts:3 i18n attribute on tags - - + `, + ` file.ts:5 nested - - + `, + ` different meaning file.ts:7 @@ -246,8 +256,8 @@ const XLIFF2_EXTRACTED = ` nested - - + `, + ` file.ts:9 file.ts:10 @@ -255,40 +265,40 @@ const XLIFF2_EXTRACTED = ` with placeholders - - + `, + ` file.ts:11 with nested placeholders - - + `, + ` file.ts:14 on not translatable node - - + `, + ` file.ts:14 <b>bold</b> - - + `, + ` file.ts:15 on translatable node - - + `, + ` file.ts:20 file.ts:37 @@ -296,8 +306,8 @@ const XLIFF2_EXTRACTED = ` {VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {many} } - - + `, + ` file.ts:22,24 @@ -306,16 +316,16 @@ const XLIFF2_EXTRACTED = ` - - + `, + ` file.ts:23 {VAR_SELECT, select, male {m} female {f} other {other} } - - + `, + ` file.ts:25,27 @@ -324,40 +334,40 @@ const XLIFF2_EXTRACTED = ` - - + `, + ` file.ts:26 {VAR_SELECT, select, male {m} female {f} } - - + `, + ` file.ts:29 - - + `, + ` file.ts:30 sex = - - + `, + ` file.ts:31 - - + `, + ` file.ts:36 file.ts:54 @@ -365,8 +375,8 @@ const XLIFF2_EXTRACTED = ` in a translatable section - - + `, + ` file.ts:34,38 @@ -377,32 +387,50 @@ const XLIFF2_EXTRACTED = ` - - + `, + ` file.ts:40 it should work - - + `, + ` file.ts:42 with an explicit ID - - + `, + ` file.ts:43 {VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {many} } - - + `, + ` + + file.ts:54 + + + foobar + + `, + ` + + file.ts:56 + + + + + ` +]; + +const LF_LINE_ENDING_XLIFF2_EXTRACTED = ` desc file.ts:46,52 @@ -410,20 +438,14 @@ const XLIFF2_EXTRACTED = ` {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } - - + `; + +const CRLF_LINE_ENDING_XLIFF2_EXTRACTED = ` - file.ts:54 + desc + file.ts:46,52 - foobar - - - - - file.ts:56 - - - + {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } `; diff --git a/packages/compiler/test/i18n/integration_xliff_spec.ts b/packages/compiler/test/i18n/integration_xliff_spec.ts index bbbcbd8bf6..3a4771494d 100644 --- a/packages/compiler/test/i18n/integration_xliff_spec.ts +++ b/packages/compiler/test/i18n/integration_xliff_spec.ts @@ -6,53 +6,52 @@ * found in the LICENSE file at https://angular.io/license */ -import {NgLocalization} from '@angular/common'; -import {ResourceLoader} from '@angular/compiler'; -import {MessageBundle} from '@angular/compiler/src/i18n/message_bundle'; import {Xliff} from '@angular/compiler/src/i18n/serializers/xliff'; -import {HtmlParser} from '@angular/compiler/src/ml_parser/html_parser'; -import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/ml_parser/interpolation_config'; -import {DebugElement, TRANSLATIONS, TRANSLATIONS_FORMAT} from '@angular/core'; -import {async, ComponentFixture, TestBed} from '@angular/core/testing'; +import {async} from '@angular/core/testing'; import {expect} from '@angular/platform-browser/testing/src/matchers'; -import {SpyResourceLoader} from '../spies'; +import {configureCompiler, createComponent, HTML, serializeTranslations, validateHtml} from './integration_common'; -import {FrLocalization, HTML, I18nComponent, validateHtml} from './integration_common'; - -{ - describe('i18n XLIFF integration spec', () => { - beforeEach(async(() => { - TestBed.configureCompiler({ - providers: [ - SpyResourceLoader.PROVIDE, - FrLocalization.PROVIDE, - {provide: TRANSLATIONS, useValue: XLIFF_TOMERGE}, - {provide: TRANSLATIONS_FORMAT, useValue: 'xliff'}, - ] - }); - - TestBed.configureTestingModule({declarations: [I18nComponent]}); - })); +describe('i18n XLIFF integration spec', () => { + describe('(with LF line endings)', () => { + beforeEach(async(() => configureCompiler(XLIFF_TOMERGE + LF_LINE_ENDING_XLIFF_TOMERGE, 'xlf'))); it('should extract from templates', () => { - const catalog = new MessageBundle(new HtmlParser, [], {}); const serializer = new Xliff(); - catalog.updateFromTemplate(HTML, 'file.ts', DEFAULT_INTERPOLATION_CONFIG); + const serializedXliff = serializeTranslations(HTML, serializer); - expect(catalog.write(serializer)).toContain(XLIFF_EXTRACTED); + XLIFF_EXTRACTED.forEach(x => { + expect(serializedXliff).toContain(x); + }); + expect(serializedXliff).toContain(LF_LINE_ENDING_XLIFF_EXTRACTED); }); it('should translate templates', () => { - const tb: ComponentFixture = - TestBed.overrideTemplate(I18nComponent, HTML).createComponent(I18nComponent); - const cmp: I18nComponent = tb.componentInstance; - const el: DebugElement = tb.debugElement; - + const {tb, cmp, el} = createComponent(HTML); validateHtml(tb, cmp, el); }); }); -} + + describe('(with CRLF line endings', () => { + beforeEach( + async(() => configureCompiler(XLIFF_TOMERGE + CRLF_LINE_ENDING_XLIFF_TOMERGE, 'xlf'))); + + it('should extract from templates (with CRLF line endings)', () => { + const serializer = new Xliff(); + const serializedXliff = serializeTranslations(HTML.replace(/\n/g, '\r\n'), serializer); + + XLIFF_EXTRACTED.forEach(x => { + expect(serializedXliff).toContain(x); + }); + expect(serializedXliff).toContain(CRLF_LINE_ENDING_XLIFF_EXTRACTED); + }); + + it('should translate templates (with CRLF line endings)', () => { + const {tb, cmp, el} = createComponent(HTML.replace(/\n/g, '\r\n')); + validateHtml(tb, cmp, el); + }); + }); +}); const XLIFF_TOMERGE = ` @@ -156,44 +155,53 @@ const XLIFF_TOMERGE = ` {VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {many} } {VAR_PLURAL, plural, =0 {zero} =1 {un} =2 {deux} other {beaucoup} } - - {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } - {VAR_PLURAL, plural, =0 {Pas de réponse} =1 {une réponse} other {Found réponse} } - desc - foobar - FOOBAR + FOOBAR `; -const XLIFF_EXTRACTED = ` - +const LF_LINE_ENDING_XLIFF_TOMERGE = + ` + {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } + {VAR_PLURAL, plural, =0 {Pas de réponse} =1 {Une réponse} other { réponses} } + desc + `; + +const CRLF_LINE_ENDING_XLIFF_TOMERGE = + ` + {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } + {VAR_PLURAL, plural, =0 {Pas de réponse} =1 {Une réponse} other { réponses} } + desc + `; + +const XLIFF_EXTRACTED: string[] = [ + ` i18n attribute on tags file.ts 3 - - + `, + ` nested file.ts 5 - - + `, + ` nested file.ts 7 different meaning - - + `, + ` with placeholders file.ts @@ -203,36 +211,36 @@ const XLIFF_EXTRACTED = ` file.ts 10 - - + `, + ` with nested placeholders file.ts 11 - - + `, + ` on not translatable node file.ts 14 - - + `, + ` <b>bold</b> file.ts 14 - - + `, + ` on translatable node file.ts 15 - - + `, + ` {VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {many} } file.ts @@ -242,8 +250,8 @@ const XLIFF_EXTRACTED = ` file.ts 37 - - + `, + ` @@ -251,15 +259,15 @@ const XLIFF_EXTRACTED = ` file.ts 22 - - + `, + ` {VAR_SELECT, select, male {m} female {f} other {other} } file.ts 23 - - + `, + ` @@ -267,36 +275,36 @@ const XLIFF_EXTRACTED = ` file.ts 25 - - + `, + ` {VAR_SELECT, select, male {m} female {f} } file.ts 26 - - + `, + ` file.ts 29 - - + `, + ` sex = file.ts 30 - - + `, + ` file.ts 31 - - + `, + ` in a translatable section file.ts @@ -306,8 +314,8 @@ const XLIFF_EXTRACTED = ` file.ts 54 - - + `, + ` Markers in html comments @@ -317,47 +325,60 @@ const XLIFF_EXTRACTED = ` file.ts 34 - - + `, + ` it should work file.ts 40 - - + `, + ` with an explicit ID file.ts 42 - - + `, + ` {VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {many} } file.ts 43 - - + `, + ` + foobar + + file.ts + 54 + + `, + ` + + + file.ts + 56 + + ` +]; + +const LF_LINE_ENDING_XLIFF_EXTRACTED = + ` + {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } + + file.ts + 46 + + desc + `; + +const CRLF_LINE_ENDING_XLIFF_EXTRACTED = + ` {VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found results} } file.ts 46 desc - - - foobar - - file.ts - 54 - - - - - - file.ts - 56 - `; diff --git a/packages/compiler/test/i18n/integration_xmb_xtb_spec.ts b/packages/compiler/test/i18n/integration_xmb_xtb_spec.ts index 7ed6fd92fd..181187f6b1 100644 --- a/packages/compiler/test/i18n/integration_xmb_xtb_spec.ts +++ b/packages/compiler/test/i18n/integration_xmb_xtb_spec.ts @@ -6,53 +6,52 @@ * found in the LICENSE file at https://angular.io/license */ -import {NgLocalization} from '@angular/common'; -import {ResourceLoader} from '@angular/compiler'; -import {MessageBundle} from '@angular/compiler/src/i18n/message_bundle'; import {Xmb} from '@angular/compiler/src/i18n/serializers/xmb'; -import {HtmlParser} from '@angular/compiler/src/ml_parser/html_parser'; -import {DEFAULT_INTERPOLATION_CONFIG} from '@angular/compiler/src/ml_parser/interpolation_config'; -import {DebugElement, TRANSLATIONS, TRANSLATIONS_FORMAT} from '@angular/core'; -import {async, ComponentFixture, TestBed} from '@angular/core/testing'; +import {async} from '@angular/core/testing'; import {expect} from '@angular/platform-browser/testing/src/matchers'; -import {SpyResourceLoader} from '../spies'; +import {configureCompiler, createComponent, HTML, serializeTranslations, validateHtml} from './integration_common'; -import {FrLocalization, HTML, I18nComponent, validateHtml} from './integration_common'; - -{ - describe('i18n XMB/XTB integration spec', () => { - beforeEach(async(() => { - TestBed.configureCompiler({ - providers: [ - SpyResourceLoader.PROVIDE, - FrLocalization.PROVIDE, - {provide: TRANSLATIONS, useValue: XTB}, - {provide: TRANSLATIONS_FORMAT, useValue: 'xtb'}, - ] - }); - - TestBed.configureTestingModule({declarations: [I18nComponent]}); - })); +describe('i18n XMB/XTB integration spec', () => { + describe('(with LF line endings)', () => { + beforeEach(async(() => configureCompiler(XTB + LF_LINE_ENDING_XTB, 'xtb'))); it('should extract from templates', () => { - const catalog = new MessageBundle(new HtmlParser, [], {}); const serializer = new Xmb(); - catalog.updateFromTemplate(HTML, 'file.ts', DEFAULT_INTERPOLATION_CONFIG); + const serializedXmb = serializeTranslations(HTML, serializer); - expect(catalog.write(serializer)).toContain(XMB); + XMB.forEach(x => { + expect(serializedXmb).toContain(x); + }); + expect(serializedXmb).toContain(LF_LINE_ENDING_XMB); }); it('should translate templates', () => { - const tb: ComponentFixture = - TestBed.overrideTemplate(I18nComponent, HTML).createComponent(I18nComponent); - const cmp: I18nComponent = tb.componentInstance; - const el: DebugElement = tb.debugElement; - + const {tb, cmp, el} = createComponent(HTML); validateHtml(tb, cmp, el); }); }); -} + + describe('(with CRLF line endings', () => { + beforeEach(async(() => configureCompiler(XTB + CRLF_LINE_ENDING_XTB, 'xtb'))); + + it('should extract from templates (with CRLF line endings)', () => { + const serializer = new Xmb(); + const serializedXmb = serializeTranslations(HTML.replace(/\n/g, '\r\n'), serializer); + + XMB.forEach(x => { + expect(serializedXmb).toContain(x); + }); + expect(serializedXmb).toContain(CRLF_LINE_ENDING_XMB); + }); + + it('should translate templates (with CRLF line endings)', () => { + const {tb, cmp, el} = createComponent(HTML.replace(/\n/g, '\r\n')); + validateHtml(tb, cmp, el); + }); + }); +}); + const XTB = ` @@ -82,40 +81,48 @@ const XTB = ` avec un ID explicite {VAR_PLURAL, plural, =0 {zero} =1 {un} =2 {deux} other {<b>beaucoup</b>} } - {VAR_PLURAL, plural, =0 {Pas de réponse} =1 {une réponse} other {INTERPOLATION réponse} } + {VAR_PLURAL, plural, =0 {Pas de réponse} =1 {Une réponse} other {INTERPOLATION réponses} } FOO<a>BAR</a> MAP_NAME `; -const XMB = `file.ts:3i18n attribute on tags - file.ts:5nested - file.ts:7nested - file.ts:9file.ts:10<i><i>with placeholders</i></i> - file.ts:11<div><div>with <div><div>nested</div></div> placeholders</div></div> - file.ts:14on not translatable node - file.ts:14<b>bold</b> - file.ts:15on translatable node - file.ts:20file.ts:37{VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {<b><b>many</b></b>} } - file.ts:22,24 +const LF_LINE_ENDING_XTB = ``; +const CRLF_LINE_ENDING_XTB = ``; + +const XMB = [ + `file.ts:3i18n attribute on tags`, + `file.ts:5nested`, + `file.ts:7nested`, + `file.ts:9file.ts:10<i><i>with placeholders</i></i>`, + `file.ts:11<div><div>with <div><div>nested</div></div> placeholders</div></div>`, + `file.ts:14on not translatable node`, + `file.ts:14<b>bold</b>`, + `file.ts:15on translatable node`, + `file.ts:20file.ts:37{VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {<b><b>many</b></b>} }`, + `file.ts:22,24 {sex, select, male {...} female {...} other {...}}{sex, select, male {...} female {...} other {...}} - - file.ts:23{VAR_SELECT, select, male {m} female {f} other {other} } - file.ts:25,27 + `, + `file.ts:23{VAR_SELECT, select, male {m} female {f} other {other} }`, + `file.ts:25,27 {sexB, select, male {...} female {...}}{sexB, select, male {...} female {...}} - - file.ts:26{VAR_SELECT, select, male {m} female {f} } - file.ts:29{{ "count = " + count }}{{ "count = " + count }} - file.ts:30sex = {{ sex }}{{ sex }} - file.ts:31{{ "custom name" //i18n(ph="CUSTOM_NAME") }}{{ "custom name" //i18n(ph="CUSTOM_NAME") }} - file.ts:36file.ts:54in a translatable section - file.ts:34,38 + `, + `file.ts:26{VAR_SELECT, select, male {m} female {f} }`, + `file.ts:29{{ "count = " + count }}{{ "count = " + count }}`, + `file.ts:30sex = {{ sex }}{{ sex }}`, + `file.ts:31{{ "custom name" //i18n(ph="CUSTOM_NAME") }}{{ "custom name" //i18n(ph="CUSTOM_NAME") }}`, + `file.ts:36file.ts:54in a translatable section`, + `file.ts:34,38 <h1><h1>Markers in html comments</h1></h1> <div><div></div></div> <div><div>{count, plural, =0 {...} =1 {...} =2 {...} other {...}}{count, plural, =0 {...} =1 {...} =2 {...} other {...}}</div></div> - - file.ts:40it <b><b>should</b></b> work - file.ts:42with an explicit ID - file.ts:43{VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {<b><b>many</b></b>} } - file.ts:46,52{VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found {{response.getItemsList().length}}{{response.getItemsList().length}} results} } - file.ts:54foo<a><a>bar</a></a> - file.ts:56{{ 'test' //i18n(ph="map name") }}{{ 'test' //i18n(ph="map name") }}`; +`, + `file.ts:40it <b><b>should</b></b> work`, + `file.ts:42with an explicit ID`, + `file.ts:43{VAR_PLURAL, plural, =0 {zero} =1 {one} =2 {two} other {<b><b>many</b></b>} }`, + `file.ts:46,52{VAR_PLURAL, plural, =0 {Found no results} =1 {Found one result} other {Found {{response.getItemsList().length}}{{response.getItemsList().length}} results} }`, + `file.ts:54foo<a><a>bar</a></a>`, + `file.ts:56{{ 'test' //i18n(ph="map name") }}{{ 'test' //i18n(ph="map name") }}` +]; + +const LF_LINE_ENDING_XMB = ``; +const CRLF_LINE_ENDING_XMB = ``;