MCPcopy Create free account
hub / github.com/angular/angular / initLocale

Function initLocale

packages/core/test/application_module_spec.ts:66–74  ·  view source on GitHub ↗
(locale: string)

Source from the content-addressed store, hash-verified

64let originalLocale: string;
65
66function initLocale(locale: string) {
67 hasGlobalLocalize = Object.getOwnPropertyNames(global).includes('$localize');
68 if (!hasGlobalLocalize) {
69 global.$localize = {};
70 }
71 hasGlobalLocale = Object.getOwnPropertyNames(global.$localize).includes('locale');
72 originalLocale = global.$localize.locale;
73 global.$localize.locale = locale;
74}
75
76function restoreLocale() {
77 if (hasGlobalLocale) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected