Skip to content

Commit

Permalink
fixup! fix(core): handle multiple i18n attributes with expression bin…
Browse files Browse the repository at this point in the history
…dings
  • Loading branch information
petebacondarwin committed Apr 29, 2021
1 parent 89f19b7 commit 3e0d8c4
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/core/test/acceptance/i18n_spec.ts
Expand Up @@ -1604,17 +1604,23 @@ onlyInIvy('Ivy i18n logic').describe('runtime i18n', () => {
});

it('multiple attributes', () => {
loadTranslations({[computeMsgId('hello {$INTERPOLATION}')]: 'bonjour {$INTERPOLATION}'});
loadTranslations({
[computeMsgId('hello {$INTERPOLATION} - {$INTERPOLATION_1}')]:
'bonjour {$INTERPOLATION} - {$INTERPOLATION_1}',
[computeMsgId('bye {$INTERPOLATION} - {$INTERPOLATION_1}')]:
'au revoir {$INTERPOLATION} - {$INTERPOLATION_1}',
});
const fixture = initWithTemplate(
AppComp,
`<input i18n i18n-title title="hello {{name}}" i18n-placeholder placeholder="hello {{name}}">`);
`<input i18n i18n-title title="hello {{name}} - {{count}}" i18n-placeholder placeholder="bye {{count}} - {{name}}">`);
expect(fixture.nativeElement.innerHTML)
.toEqual(`<input title="bonjour Angular" placeholder="bonjour Angular">`);
.toEqual(`<input title="bonjour Angular - 0" placeholder="au revoir 0 - Angular">`);

fixture.componentRef.instance.name = 'John';
fixture.componentRef.instance.count = 5;
fixture.detectChanges();
expect(fixture.nativeElement.innerHTML)
.toEqual(`<input title="bonjour John" placeholder="bonjour John">`);
.toEqual(`<input title="bonjour John - 5" placeholder="au revoir 5 - John">`);
});

it('on removed elements', () => {
Expand Down

0 comments on commit 3e0d8c4

Please sign in to comment.