You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
$localize is not found after ng add with cli v15.0.0-next.4 and ng v15.0.0-next.5 #47677
area: i18nIssues related to localization and internationalizationbugregressionIndicates than the issue relates to something that worked in a previous version
Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
14.2.5
Description
Angular v15.0.0-next.5 contains the fix from @alan-agius4 to properly add the @angular/localize polyfill in a CLI app now that the polyfills.ts file is gone. 400a6b5
The polyfill is added when running ng add, but it looks like using $localize still doesn't work.
Error: src/app/app.component.ts:9:11 - error TS2304: Cannot find name '$localize'.
9 title = $localize`i18n-next`;
changed the title [-]$localize is not found after `ng add` with cli/ng v15.0.0-next.4[/-][+]$localize is not found after `ng add` with cli v15.0.0-next.4 and ng v15.0.0-next.5[/+]on Oct 6, 2022
The problem here is that while we are adding @angular/localize/init to the polyfills this is not included as part of the TypeScript compilation which caused the global $localize type to not be added.
Therefore we'd need to add "@angular/localize/init" as a type in the TypeScript configurations.
I am going to transfer this to the framework as this needs to be addressed by the ng-add schematic.
changed the title [-]$localize is not found after `ng add` with cli v15.0.0-next.4 and ng v15.0.0-next.5[/-][+]`$localize` is not found after `ng add` with cli v15.0.0-next.4 and ng v15.0.0-next.5[/+]on Oct 6, 2022
area: i18nIssues related to localization and internationalizationbugregressionIndicates than the issue relates to something that worked in a previous version
Activity
[-]$localize is not found after `ng add` with cli/ng v15.0.0-next.4[/-][+]$localize is not found after `ng add` with cli v15.0.0-next.4 and ng v15.0.0-next.5[/+]alan-agius4 commentedon Oct 6, 2022
The problem here is that while we are adding
@angular/localize/initto the polyfills this is not included as part of the TypeScript compilation which caused the global$localizetype to not be added.Therefore we'd need to add
"@angular/localize/init"as atypein the TypeScript configurations.I am going to transfer this to the framework as this needs to be addressed by the
ng-addschematic.[-]$localize is not found after `ng add` with cli v15.0.0-next.4 and ng v15.0.0-next.5[/-][+]`$localize` is not found after `ng add` with cli v15.0.0-next.4 and ng v15.0.0-next.5[/+]3 remaining items
feat(@angular-devkit/build-angular): auto include `@angular/localize/…
feat(@angular-devkit/build-angular): auto include `@angular/localize/…
feat(@angular-devkit/build-angular): auto include `@angular/localize/…
fix(localize): update ng add schematic to support Angular CLI version 15
fix(localize): update ng add schematic to support Angular CLI version…
angular-automatic-lock-bot commentedon Nov 17, 2022
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.