← All recipes
Moderne licensed

Add @angular/localize/init polyfill import

Recipe IDorg.openrewrite.angular.migration.add-localize-polyfillArtifact@openrewrite/recipes-angular

Adds import '@angular/localize/init' to polyfills.ts. Angular 9 introduced the $localize runtime API for i18n. Projects using internationalization must import this polyfill or the application will fail at runtime with $localize is not defined. The @angular/localize package must also be added as a dependency.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.angular.migration.add-localize-polyfill

If the recipe isn’t available locally, install it with:

mod config recipes npm install @openrewrite/recipes-angular