Thanks to visit codestin.com
Credit goes to github.com

Skip to content

i18n: equiv-text value is not trimmedΒ #41176

@kamilchlebek

Description

@kamilchlebek

🐞 bug report

Affected Package

The issue is caused by package @angular/localize

Is this a regression?

Yes, the previous version in which this bug was not present was: v10

Description

Plurals. Unnecessary line break is added before closing " in equiv-text attribute

Given template:

<a i18n>
  {{ 1 }} {1, plural, =1 {one} other {more}}
</a>

βœ… Angular 10:

<source>
  <x id="INTERPOLATION" equiv-text="{{ 1 }}"/> <x id="ICU" equiv-text="{1, plural, =1 {...} other {...}}"/>
</source>

❌ Angular 11:

<source> <x id="INTERPOLATION" equiv-text="{{ 1 }}"/> <x id="ICU" equiv-text="{1, plural, =1 {one} other {more}}
"/>
</source>

ng-bootstrap translations

I couldn't reproduce it with my own example, so I'll demonstrate it using ng-bootstrap.

βœ… Angular 10:

<source>
          Slide <x id="INTERPOLATION" equiv-text="{{i + 1}}"/> of <x id="INTERPOLATION_1" equiv-text="{{c}}"/>
        </source>

❌ Angular 11:

<source> Slide <x id="INTERPOLATION" equiv-text="private _pauseO"/> of <x id="INTERPOLATION_1" equiv-text="Subject(false);"/> </source>

πŸ”¬ Minimal Reproduction

https://github.com/kamilchlebek/equiv-text-angular11/tree/demo/angular-11.2.5

Compare v10 messages: https://github.com/kamilchlebek/equiv-text-angular11/blob/demo/angular-11.2.5/messages.v10.xlf
with v11 messages: https://github.com/kamilchlebek/equiv-text-angular11/blob/demo/angular-11.2.5/messages.xlf

🌍 Your Environment

Angular Version:

Angular CLI: 11.2.4
Node: 12.16.1
OS: darwin x64

Angular: 11.2.5
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1102.4
@angular-devkit/build-angular   0.1102.4
@angular-devkit/core            11.2.4
@angular-devkit/schematics      11.2.4
@angular/cli                    11.2.4
@schematics/angular             11.2.4
@schematics/update              0.1102.4
rxjs                            6.6.3
typescript                      4.0.5

Metadata

Metadata

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: i18nIssues related to localization and internationalizationstate: has PR

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions