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:
Pete Bacon Darwin
2021-10-20 22:08:50 +01:00
committed by Alex Rickabaugh
parent 70d3805fd6
commit c315878910
4 changed files with 4 additions and 19 deletions
+1 -7
View File
@@ -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"
}
]
]