(id: string)
| 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 }; |