MCPcopy Create free account
hub / github.com/DTStack/molecule / setCurrentLocale

Method setCurrentLocale

src/i18n/localeService.ts:133–143  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

131 }
132
133 public setCurrentLocale(id: string): boolean {
134 if (this._current && this._current.id === id) return true;
135 const locale = this._locales.get(id);
136 if (locale) {
137 this.emit(LocalizationEvent.OnChange, this._current, locale);
138 this._current = locale;
139 localStorage.setItem(STORE_KEY, locale.id);
140 return true;
141 }
142 return false;
143 }
144
145 private transformLocaleData(locale: ILocale): ILocale {
146 const newLocale = { ...locale };

Callers

nothing calls this directly

Calls 2

emitMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected