docs(ivy): improve the missing `$localize` error message (#33826)
If the application is not running directly in the browser, e.g. universal or app-shell, then the `$localize` import must be adding to a different file than for normal browser applications. This commit adds more information about this to avoid any confusion. // FW-1557 PR Close #33826
This commit is contained in:
parent
7bf3e70553
commit
8f034896a3
|
@ -13,5 +13,5 @@ const __global = "undefined" !== typeof global && global;
|
||||||
const _global = __globalThis || __global || __window || __self;
|
const _global = __globalThis || __global || __window || __self;
|
||||||
|
|
||||||
if (ngDevMode) _global.$localize = _global.$localize || function() {
|
if (ngDevMode) _global.$localize = _global.$localize || function() {
|
||||||
throw new Error("It looks like your application or one of its dependencies is using i18n.\n" + "Angular 9 introduced a global `$localize()` function that needs to be loaded.\n" + "Please run `ng add @angular/localize` from the Angular CLI.\n" + "(For non-CLI projects, add `import '@angular/localize/init';` to your polyfills.ts file)");
|
throw new Error("It looks like your application or one of its dependencies is using i18n.\n" + "Angular 9 introduced a global `$localize()` function that needs to be loaded.\n" + "Please run `ng add @angular/localize` from the Angular CLI.\n" + "(For non-CLI projects, add `import '@angular/localize/init';` to your `polyfills.ts` file.\n" + "For server-side rendering applications add the import to your `main.server.ts` file.)");
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,5 +15,5 @@ var __global = "undefined" !== typeof global && global;
|
||||||
var _global = __globalThis || __global || __window || __self;
|
var _global = __globalThis || __global || __window || __self;
|
||||||
|
|
||||||
if (ngDevMode) _global.$localize = _global.$localize || function() {
|
if (ngDevMode) _global.$localize = _global.$localize || function() {
|
||||||
throw new Error("It looks like your application or one of its dependencies is using i18n.\n" + "Angular 9 introduced a global `$localize()` function that needs to be loaded.\n" + "Please run `ng add @angular/localize` from the Angular CLI.\n" + "(For non-CLI projects, add `import '@angular/localize/init';` to your polyfills.ts file)");
|
throw new Error("It looks like your application or one of its dependencies is using i18n.\n" + "Angular 9 introduced a global `$localize()` function that needs to be loaded.\n" + "Please run `ng add @angular/localize` from the Angular CLI.\n" + "(For non-CLI projects, add `import '@angular/localize/init';` to your `polyfills.ts` file.\n" + "For server-side rendering applications add the import to your `main.server.ts` file.)");
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,6 +48,7 @@ if (ngDevMode) {
|
||||||
'It looks like your application or one of its dependencies is using i18n.\n' +
|
'It looks like your application or one of its dependencies is using i18n.\n' +
|
||||||
'Angular 9 introduced a global `$localize()` function that needs to be loaded.\n' +
|
'Angular 9 introduced a global `$localize()` function that needs to be loaded.\n' +
|
||||||
'Please run `ng add @angular/localize` from the Angular CLI.\n' +
|
'Please run `ng add @angular/localize` from the Angular CLI.\n' +
|
||||||
'(For non-CLI projects, add `import \'@angular/localize/init\';` to your polyfills.ts file)');
|
'(For non-CLI projects, add `import \'@angular/localize/init\';` to your `polyfills.ts` file.\n' +
|
||||||
|
'For server-side rendering applications add the import to your `main.server.ts` file.)');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue