mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
refactor: simplify the LOCALE_ID provider (#43913)
Other parts of the intialization process are responsible for passing the locale id to ivy, so it does not need to happen in the provider factory. E.g. `PlatformRef.bootstrapModule()` and `R3TestBedCompiler.finalize()`. PR Close #43913
This commit is contained in:
committed by
Alex Rickabaugh
parent
70d3805fd6
commit
c315878910
@@ -20,7 +20,6 @@ import {ComponentFactoryResolver} from './linker';
|
||||
import {Compiler} from './linker/compiler';
|
||||
import {NgModule} from './metadata';
|
||||
import {SCHEDULER} from './render3/component_ref';
|
||||
import {setLocaleId} from './render3/i18n/i18n_locale_id';
|
||||
import {NgZone} from './zone';
|
||||
|
||||
declare const $localize: {locale?: string};
|
||||
@@ -34,13 +33,8 @@ export function _keyValueDiffersFactory() {
|
||||
}
|
||||
|
||||
export function _localeFactory(locale?: string): string {
|
||||
locale = locale || getGlobalLocale();
|
||||
if (ivyEnabled) {
|
||||
setLocaleId(locale);
|
||||
}
|
||||
return locale;
|
||||
return locale || getGlobalLocale();
|
||||
}
|
||||
|
||||
/**
|
||||
* Work out the locale from the potential global properties.
|
||||
*
|
||||
|
||||
@@ -1532,9 +1532,6 @@
|
||||
{
|
||||
"name": "setIsInCheckNoChangesMode"
|
||||
},
|
||||
{
|
||||
"name": "setLocaleId"
|
||||
},
|
||||
{
|
||||
"name": "setSelectedIndex"
|
||||
},
|
||||
@@ -1682,4 +1679,4 @@
|
||||
{
|
||||
"name": "ɵɵtext"
|
||||
}
|
||||
]
|
||||
]
|
||||
@@ -1505,9 +1505,6 @@
|
||||
{
|
||||
"name": "setIsInCheckNoChangesMode"
|
||||
},
|
||||
{
|
||||
"name": "setLocaleId"
|
||||
},
|
||||
{
|
||||
"name": "setSelectedIndex"
|
||||
},
|
||||
@@ -1664,4 +1661,4 @@
|
||||
{
|
||||
"name": "ɵɵtext"
|
||||
}
|
||||
]
|
||||
]
|
||||
@@ -1928,9 +1928,6 @@
|
||||
{
|
||||
"name": "setIsInCheckNoChangesMode"
|
||||
},
|
||||
{
|
||||
"name": "setLocaleId"
|
||||
},
|
||||
{
|
||||
"name": "setRouterState"
|
||||
},
|
||||
@@ -2138,4 +2135,4 @@
|
||||
{
|
||||
"name": "ɵɵtextInterpolate1"
|
||||
}
|
||||
]
|
||||
]
|
||||
Reference in New Issue
Block a user