feat: add i18n translations for book components, services, and readers (en/es) (#2738)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import {Injectable, inject} from '@angular/core';
|
||||
import {AppSettingsService} from './app-settings.service';
|
||||
import {MessageService} from 'primeng/api';
|
||||
import {TranslocoService} from '@jsverse/transloco';
|
||||
import {Observable} from 'rxjs';
|
||||
|
||||
@Injectable({
|
||||
@@ -10,6 +11,7 @@ export class SettingsHelperService {
|
||||
|
||||
private readonly appSettingsService = inject(AppSettingsService);
|
||||
private readonly messageService = inject(MessageService);
|
||||
private readonly t = inject(TranslocoService);
|
||||
|
||||
saveSetting(key: string, value: unknown): Observable<void> {
|
||||
const observable = this.appSettingsService.saveSettings([{key, newValue: value}]);
|
||||
@@ -28,16 +30,16 @@ export class SettingsHelperService {
|
||||
private showSuccessMessage(): void {
|
||||
this.messageService.add({
|
||||
severity: 'success',
|
||||
summary: 'Settings Saved',
|
||||
detail: 'The settings were successfully saved!'
|
||||
summary: this.t.translate('shared.settingsHelper.settingsSavedSummary'),
|
||||
detail: this.t.translate('shared.settingsHelper.settingsSavedDetail')
|
||||
});
|
||||
}
|
||||
|
||||
private showErrorMessage(): void {
|
||||
this.messageService.add({
|
||||
severity: 'error',
|
||||
summary: 'Error',
|
||||
detail: 'There was an error saving the settings.'
|
||||
summary: this.t.translate('common.error'),
|
||||
detail: this.t.translate('shared.settingsHelper.saveErrorDetail')
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user