feat: add i18n translations for stats, pdf reader, magic shelf, and remaining components (en/es) (#2742)

This commit is contained in:
ACX
2026-02-14 00:18:26 -07:00
committed by GitHub
parent ffd2adb032
commit 9fa7b0736c
102 changed files with 3177 additions and 991 deletions
@@ -110,7 +110,7 @@ export class CustomFontsComponent implements OnInit {
this.customFonts = this.customFonts.filter(f => f.id !== font.id);
this.messageService.add({
severity: 'success',
summary: 'Success',
summary: this.t.translate('common.success'),
detail: this.t.translate('settingsReader.fonts.deleteSuccess', {name: font.fontName})
});
},
@@ -203,6 +203,16 @@ export const DEFAULT_VISIBLE_FILTERS: VisibleFilterType[] = [
'matchScore', 'publisher', 'publishedDate', 'fileSize'
];
// Translation key for each filter option — use book.filter.labels.<value>
export const ALL_FILTER_OPTION_VALUES: VisibleFilterType[] = [
'author', 'category', 'series', 'bookType', 'readStatus',
'personalRating', 'library', 'tag', 'ageRating', 'contentRating',
'matchScore', 'publisher', 'publishedDate', 'fileSize', 'shelf',
'shelfStatus', 'language', 'pageCount', 'mood', 'amazonRating',
'goodreadsRating', 'hardcoverRating', 'narrator',
'comicCharacter', 'comicTeam', 'comicLocation', 'comicCreator'
];
export const ALL_FILTER_OPTIONS: { label: string; value: VisibleFilterType }[] = [
{label: 'Author', value: 'author'},
{label: 'Genre', value: 'category'},
@@ -104,7 +104,7 @@ export class UserProfileDialogComponent implements OnInit, OnDestroy {
}
if (this.editUserData.name === this.currentUser.name && this.editUserData.email === this.currentUser.email) {
this.messageService.add({severity: 'info', summary: 'Info', detail: this.t.translate('settingsProfile.toast.noChanges')});
this.messageService.add({severity: 'info', summary: this.t.translate('common.info'), detail: this.t.translate('settingsProfile.toast.noChanges')});
this.isEditing = false;
return;
}
@@ -1,6 +1,7 @@
import {Component, ElementRef, inject, OnDestroy, OnInit, viewChild} from '@angular/core';
import {Select} from 'primeng/select';
import {ALL_FILTER_OPTIONS, BookFilterMode, DEFAULT_VISIBLE_FILTERS, User, UserService, UserSettings, UserState, VisibleFilterType} from '../../user-management/user.service';
import {ALL_FILTER_OPTION_VALUES, ALL_FILTER_OPTIONS, BookFilterMode, DEFAULT_VISIBLE_FILTERS, User, UserService, UserSettings, UserState, VisibleFilterType} from '../../user-management/user.service';
import {FILTER_LABEL_KEYS} from '../../../book/components/book-browser/book-filter/book-filter.config';
import {MessageService} from 'primeng/api';
import {Observable, Subject} from 'rxjs';
import {FormsModule} from '@angular/forms';
@@ -100,11 +101,14 @@ export class FilterPreferencesComponent implements OnInit, OnDestroy {
get availableFilters(): {label: string; value: string}[] {
const used = new Set(this.selectedVisibleFilters);
return this.allFilterOptions.filter(opt => !used.has(opt.value));
return ALL_FILTER_OPTION_VALUES
.filter(v => !used.has(v))
.map(v => ({label: this.getFilterLabel(v), value: v}));
}
getFilterLabel(value: string): string {
return this.allFilterOptions.find(opt => opt.value === value)?.label ?? value;
const key = FILTER_LABEL_KEYS[value as keyof typeof FILTER_LABEL_KEYS];
return key ? this.t.translate(key) : value;
}
onDrop(event: CdkDragDrop<VisibleFilterType[]>): void {