mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-21 09:03:02 +00:00
@@ -17,9 +17,9 @@ import {Geolocation} from '@ionic-native/geolocation/ngx';
|
||||
import {AlertController} from '@ionic/angular';
|
||||
import {LangChangeEvent, TranslateService} from '@ngx-translate/core';
|
||||
import {
|
||||
SCLanguageName,
|
||||
SCSetting,
|
||||
SCSettingMeta,
|
||||
SCTranslations,
|
||||
} from '@openstapps/core';
|
||||
import {SettingsProvider} from '../settings.provider';
|
||||
|
||||
@@ -29,7 +29,8 @@ import {SettingsProvider} from '../settings.provider';
|
||||
})
|
||||
export class SettingsItemComponent {
|
||||
isVisible = true;
|
||||
language: SCLanguageName;
|
||||
// limit to languages that are available in StApps Core
|
||||
language: keyof SCTranslations<any>;
|
||||
meta = SCSettingMeta;
|
||||
|
||||
@Input() setting: SCSetting;
|
||||
@@ -40,11 +41,11 @@ export class SettingsItemComponent {
|
||||
private geoLocation: Geolocation) {
|
||||
this.meta = SCSettingMeta;
|
||||
|
||||
this.language = translateService.currentLang as SCLanguageName;
|
||||
this.language = translateService.currentLang as keyof SCTranslations<any>;
|
||||
|
||||
translateService.onLangChange.subscribe((event: LangChangeEvent) => {
|
||||
this.isVisible = false;
|
||||
this.language = event.lang as SCLanguageName;
|
||||
this.language = event.lang as keyof SCTranslations<any>;
|
||||
// workaround for selected 'select option' not updating translation
|
||||
setTimeout(() => this.isVisible = true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user