forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(compiler): ICUs should roll up to the root i18n block for ap…
…plication Previously, if an ICU was inside a nested i18n root, it would use the nested root to calculate whether it should be applied. Now, we use the root i18n block.
- Loading branch information
Showing
5 changed files
with
88 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_i18n/icu_and_i18n.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
function MyComponent_div_2_Template(rf, ctx) { | ||
if (rf & 1) { | ||
i0.ɵɵi18nStart(0, 0, 1); | ||
i0.ɵɵelement(1, "div"); | ||
i0.ɵɵi18nEnd(); | ||
} if (rf & 2) { | ||
const diskView_r1 = ctx.$implicit; | ||
i0.ɵɵadvance(); | ||
i0.ɵɵi18nExp(diskView_r1.name)(diskView_r1.length); | ||
i0.ɵɵi18nApply(0); | ||
} | ||
} | ||
… | ||
function MyComponent_Template(rf, ctx) { | ||
if (rf & 1) { | ||
i0.ɵɵelementStart(0, "div"); | ||
i0.ɵɵi18nStart(1, 0); | ||
i0.ɵɵtemplate(2, MyComponent_div_2_Template, 2, 2, "div", 1); | ||
i0.ɵɵi18nEnd(); | ||
i0.ɵɵelementEnd(); | ||
} if (rf & 2) { | ||
i0.ɵɵadvance(2); | ||
i0.ɵɵproperty("ngForOf", ctx.disks); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/compiler-cli/test/compliance/test_cases/r3_view_compiler_i18n/icu_and_i18n.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'my-component', | ||
standalone: true, | ||
template: ` | ||
<div i18n> | ||
<div *ngFor="let diskView of disks"> | ||
{{diskView.name}} has {diskView.length, plural, =1 {VM} other {VMs}} | ||
</div> | ||
</div> | ||
`, | ||
}) | ||
export class MyComponent { | ||
disks: any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters