diff --git a/integration/side-effects/snapshots/core/esm2015.js b/integration/side-effects/snapshots/core/esm2015.js index 47de5e87133b3..3c9b0a8fee2e9 100644 --- a/integration/side-effects/snapshots/core/esm2015.js +++ b/integration/side-effects/snapshots/core/esm2015.js @@ -13,5 +13,5 @@ const __global = "undefined" !== typeof global && global; const _global = __globalThis || __global || __window || __self; if (ngDevMode) _global.$localize = _global.$localize || function() { - throw new Error("The global function `$localize` is missing. Please add `import '@angular/localize';` 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 add `import '@angular/localize';` to your polyfills.ts file."); }; diff --git a/integration/side-effects/snapshots/core/esm5.js b/integration/side-effects/snapshots/core/esm5.js index d5fd28b2d86ec..ba58f35bd71c1 100644 --- a/integration/side-effects/snapshots/core/esm5.js +++ b/integration/side-effects/snapshots/core/esm5.js @@ -15,5 +15,5 @@ var __global = "undefined" !== typeof global && global; var _global = __globalThis || __global || __window || __self; if (ngDevMode) _global.$localize = _global.$localize || function() { - throw new Error("The global function `$localize` is missing. Please add `import '@angular/localize';` 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 add `import '@angular/localize';` to your polyfills.ts file."); }; diff --git a/packages/core/src/core.ts b/packages/core/src/core.ts index 598d681e4b728..4b66d5f5f3b27 100644 --- a/packages/core/src/core.ts +++ b/packages/core/src/core.ts @@ -45,6 +45,8 @@ if (ngDevMode) { // tslint:disable-next-line: no-toplevel-property-access global.$localize = global.$localize || function() { throw new Error( - 'The global function `$localize` is missing. Please add `import \'@angular/localize\';` to your polyfills.ts file.'); + '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 add `import \'@angular/localize\';` to your polyfills.ts file.'); }; }