1234567891011121314151617181920212223242526272829 |
- export class LanguageServiceNoLS {
- private listeners: Array<() => void> = [];
- constructor (private lang: string) { }
- setupListener (): void { }
- notifyChange (): void {
- this.listeners.forEach(l => l());
- }
- setLang (lang: string): void {
- this.lang = lang;
- this.notifyChange();
- }
- getLang (): string {
- return this.lang;
- }
- getDefaultLang (): string {
- return this.lang;
- }
- registerLanguageChangeListener (listener: () => void) {
- this.listeners.push(listener);
- }
- }
|