diff --git a/booklore-ui/README.md b/booklore-ui/README.md index 1f940671f..e7cfe5f1e 100644 --- a/booklore-ui/README.md +++ b/booklore-ui/README.md @@ -1,4 +1,4 @@ -# BookLore +# Grimmory This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.2. diff --git a/booklore-ui/angular.json b/booklore-ui/angular.json index a6d2f8e96..6644ce557 100644 --- a/booklore-ui/angular.json +++ b/booklore-ui/angular.json @@ -3,7 +3,7 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "booklore": { + "grimmory": { "projectType": "application", "schematics": { "@schematics/angular:component": { @@ -100,10 +100,10 @@ "builder": "@angular/build:dev-server", "configurations": { "production": { - "buildTarget": "booklore:build:production" + "buildTarget": "grimmory:build:production" }, "development": { - "buildTarget": "booklore:build:development" + "buildTarget": "grimmory:build:development" } }, "defaultConfiguration": "development" diff --git a/booklore-ui/package-lock.json b/booklore-ui/package-lock.json index 142b3a84a..09ac82d7d 100644 --- a/booklore-ui/package-lock.json +++ b/booklore-ui/package-lock.json @@ -1,11 +1,11 @@ { - "name": "booklore", + "name": "grimmory", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "booklore", + "name": "grimmory", "version": "0.0.0", "dependencies": { "@angular/animations": "^21.2.4", diff --git a/booklore-ui/package.json b/booklore-ui/package.json index 19c7e24f4..dedd33f35 100644 --- a/booklore-ui/package.json +++ b/booklore-ui/package.json @@ -1,5 +1,5 @@ { - "name": "booklore", + "name": "grimmory", "version": "0.0.0", "scripts": { "ng": "ng", diff --git a/booklore-ui/public/manifest.webmanifest b/booklore-ui/public/manifest.webmanifest index 77258fb26..83042de61 100644 --- a/booklore-ui/public/manifest.webmanifest +++ b/booklore-ui/public/manifest.webmanifest @@ -1,6 +1,6 @@ { - "name": "booklore", - "short_name": "booklore", + "name": "Grimmory", + "short_name": "Grimmory", "display": "fullscreen", "display_override": ["fullscreen", "standalone", "browser"], "scope": "./", diff --git a/booklore-ui/src/app/core/config/language-initializer.ts b/booklore-ui/src/app/core/config/language-initializer.ts index 1a0260dca..b43ecd627 100644 --- a/booklore-ui/src/app/core/config/language-initializer.ts +++ b/booklore-ui/src/app/core/config/language-initializer.ts @@ -3,11 +3,14 @@ import {TranslocoService} from '@jsverse/transloco'; import {firstValueFrom} from 'rxjs'; import {AVAILABLE_LANGS} from './transloco-loader'; -export const LANG_STORAGE_KEY = 'booklore-lang'; +// TODO(grimmory-cleanup): Remove after the Booklore-to-Grimmory localStorage migration window closes. +export const LEGACY_LANG_STORAGE_KEY = 'booklore-lang'; +export const LANG_STORAGE_KEY = 'grimmory-lang'; function detectLanguage(available: string[]): string { - const saved = localStorage.getItem(LANG_STORAGE_KEY); + const saved = localStorage.getItem(LANG_STORAGE_KEY) ?? localStorage.getItem(LEGACY_LANG_STORAGE_KEY); if (saved && available.includes(saved)) { + localStorage.setItem(LANG_STORAGE_KEY, saved); return saved; } @@ -29,6 +32,7 @@ export function initializeLanguage() { const translocoService = inject(TranslocoService); const lang = detectLanguage(AVAILABLE_LANGS); translocoService.setActiveLang(lang); + localStorage.setItem(LANG_STORAGE_KEY, lang); return firstValueFrom(translocoService.load(lang)); }; } diff --git a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts index d78b2a320..d3849f28b 100644 --- a/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts +++ b/booklore-ui/src/app/features/book/components/book-browser/book-card/book-card.component.ts @@ -185,7 +185,7 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy { const progressParts: string[] = []; if (this._progressPercentage !== null) { - progressParts.push(`${this._progressPercentage}% (BookLore)`); + progressParts.push(`${this._progressPercentage}% (Grimmory)`); } if (this._koProgressPercentage !== null) { progressParts.push(`${this._koProgressPercentage}% (KOReader)`); @@ -619,7 +619,7 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy { label: this.t.translate('book.card.menu.resetGrimmoryProgress'), icon: 'pi pi-undo', command: () => { - this.bookService.resetProgress(this.book.id, ResetProgressTypes.BOOKLORE).subscribe({ + this.bookService.resetProgress(this.book.id, ResetProgressTypes.GRIMMORY).subscribe({ next: () => { this.messageService.add({ severity: 'success', diff --git a/booklore-ui/src/app/features/book/service/book-menu.service.ts b/booklore-ui/src/app/features/book/service/book-menu.service.ts index 691baf89b..ff680c9bc 100644 --- a/booklore-ui/src/app/features/book/service/book-menu.service.ts +++ b/booklore-ui/src/app/features/book/service/book-menu.service.ts @@ -356,7 +356,7 @@ export class BookMenuService { }); } - if (permissions?.canBulkResetBookloreReadProgress) { + if (permissions?.canBulkResetGrimmoryReadProgress ?? permissions?.canBulkResetBookloreReadProgress) { items.push({ label: this.t.translate('book.menuService.menu.resetGrimmoryProgress'), icon: 'pi pi-undo', @@ -370,7 +370,7 @@ export class BookMenuService { accept: () => { const loader = this.loadingService.show(this.t.translate('book.menuService.loading.resettingGrimmoryProgress', {count})); - this.bookService.resetProgress(Array.from(selectedBooks), ResetProgressTypes.BOOKLORE) + this.bookService.resetProgress(Array.from(selectedBooks), ResetProgressTypes.GRIMMORY) .pipe(finalize(() => this.loadingService.hide(loader))) .subscribe({ next: () => { diff --git a/booklore-ui/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html b/booklore-ui/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html index 1bef88c44..c8a387c09 100644 --- a/booklore-ui/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html +++ b/booklore-ui/src/app/features/bookdrop/component/bookdrop-file-review/bookdrop-file-review.component.html @@ -4,7 +4,7 @@