diff --git a/packages/core/src/application_module.ts b/packages/core/src/application_module.ts index 1079d19812..5ad90e2e85 100644 --- a/packages/core/src/application_module.ts +++ b/packages/core/src/application_module.ts @@ -44,16 +44,16 @@ export function _localeFactory(locale?: string): string { /** * Work out the locale from the potential global properties. * - * * Closure Compiler: use `goog.LOCALE`. + * * Closure Compiler: use `goog.getLocale()`. * * Ivy enabled: use `$localize.locale` */ export function getGlobalLocale(): string { if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode && - typeof goog !== 'undefined' && goog.LOCALE !== 'en') { - // * The default `goog.LOCALE` value is `en`, while Angular used `en-US`. + typeof goog !== 'undefined' && goog.getLocale() !== 'en') { + // * The default `goog.getLocale()` value is `en`, while Angular used `en-US`. // * In order to preserve backwards compatibility, we use Angular default value over // Closure Compiler's one. - return goog.LOCALE; + return goog.getLocale(); } else { // KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE // COMPILE-TIME INLINER. diff --git a/packages/goog.d.ts b/packages/goog.d.ts index 1ea0320485..f8b4724929 100644 --- a/packages/goog.d.ts +++ b/packages/goog.d.ts @@ -18,6 +18,7 @@ declare namespace goog { export const DEBUG: boolean; export const LOCALE: string; export const getMsg: (input: string, placeholders?: {[key: string]: string}) => string; + export const getLocale: () => string; } /**