Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/core/src/i18n/tokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ declare const $localize: {locale?: string};
/**
* Work out the locale from the potential global properties.
*
* * Closure Compiler: use `goog.getLocale()`.
* * Closure Compiler: use `goog.LOCALE`.
* * Ivy enabled: use `$localize.locale`
*/
export function getGlobalLocale(): string {
if (typeof ngI18nClosureMode !== 'undefined' && ngI18nClosureMode &&
typeof goog !== 'undefined' && goog.getLocale() !== 'en') {
// * The default `goog.getLocale()` value is `en`, while Angular used `en-US`.
typeof goog !== 'undefined' && goog.LOCALE !== 'en') {
// * The default `goog.LOCALE` 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.getLocale();
return goog.LOCALE;
} else {
// KEEP `typeof $localize !== 'undefined' && $localize.locale` IN SYNC WITH THE LOCALIZE
// COMPILE-TIME INLINER.
Expand Down