I'm getting the following error in my new angular project setup.
Installed Packages and its versions
ERROR Error: Uncaught (in promise): Error: It looks like your application or one of its dependencies is using i18n. Angular 9 introduced a global
$localize()
function that needs to be loaded. Please addimport '@angular/localize';
to your polyfills.ts file. Error: It looks like your application or one of its dependencies is using i18n. Angular 9 introduced a global$localize()
function that needs to be loaded.
Note: I came from the following. It suggests falling back to old version. https://github.com/angular/angular/issues/32508
@angular/localize/initlinkThe @angular/localize package exposes the $localize function in the global namespace, which can be used to tag i18n messages in your code that needs to be translated.
Angular Internationalizationlink Localization is the process of building versions of your project for different locales. The localization process includes the following actions. A locale identifies a region in which people speak a particular language or language variant.
1. Angular CLI provides extract-i18n command to extract the marked text in the component into a source language file. 2. The extract-i18n command is run from project root directory as following. ng extract-i18n.
You need to make sure you have the @angular/localize package first:
npm install @angular/localize --save
Then, import '@angular/localize/init'
in your polyfills.ts file just like the error says
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With