mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
refactor: some i18n improvements
This commit is contained in:
2 files changed
+16
-20
No files matched your search
+11
-13
@@ -96,19 +96,17 @@ export class AppComponent {
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
this.storage.get('settings').subscribe((settings: Settings) => {
|
||||
if (
|
||||
settings &&
|
||||
Object.keys(settings).length > 0 &&
|
||||
settings.epgUrl
|
||||
) {
|
||||
this.translate.setDefaultLang(settings.language ?? 'en');
|
||||
this.electronService.ipcRenderer.send(EPG_FETCH, {
|
||||
url: settings.epgUrl,
|
||||
});
|
||||
this.snackBar.open('Fetch EPG data...', 'Close', {
|
||||
verticalPosition: 'bottom',
|
||||
horizontalPosition: 'right',
|
||||
});
|
||||
if (settings && Object.keys(settings).length > 0) {
|
||||
this.translate.use(settings.language ?? 'en');
|
||||
if (settings.epgUrl) {
|
||||
this.electronService.ipcRenderer.send(EPG_FETCH, {
|
||||
url: settings.epgUrl,
|
||||
});
|
||||
this.snackBar.open('Fetch EPG data...', 'Close', {
|
||||
verticalPosition: 'bottom',
|
||||
horizontalPosition: 'right',
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -134,6 +134,11 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
.set('settings', this.settingsForm.value)
|
||||
.subscribe(() => {
|
||||
this.settingsForm.markAsPristine();
|
||||
// check whether the epg url was changed or not
|
||||
if (this.settingsForm.value.epgUrl) {
|
||||
this.fetchEpg();
|
||||
}
|
||||
this.translate.use(this.settingsForm.value.language);
|
||||
this.snackBar.open(
|
||||
this.translate.instant('SETTINGS.SETTINGS_SAVED'),
|
||||
null,
|
||||
@@ -141,13 +146,6 @@ export class SettingsComponent implements OnInit, OnDestroy {
|
||||
duration: 2000,
|
||||
}
|
||||
);
|
||||
// check whether the epg url was changed or not
|
||||
if (this.settingsForm.value.epgUrl) {
|
||||
this.fetchEpg();
|
||||
}
|
||||
this.translate.setDefaultLang(
|
||||
this.settingsForm.value.language
|
||||
);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user