Mise en place de l'anglais comme deuxième langue pour l'application
Some checks failed
Build & Push Images / build (brain) (push) Has been cancelled
Build & Push Images / build (core) (push) Has been cancelled
Build & Push Images / build (web) (push) Has been cancelled
Build & Push Images / build-switcher (push) Has been cancelled

This commit is contained in:
2026-06-14 16:24:05 +02:00
parent 6e75326779
commit af3a6d443c
198 changed files with 7801 additions and 1720 deletions

View File

@@ -4,6 +4,7 @@ import { FormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { forkJoin } from 'rxjs';
import { LucideAngularModule, Sparkles, Plus, Trash2 } from 'lucide-angular';
import { TranslatePipe, TranslateService } from '@ngx-translate/core';
import { LoreService } from '../../services/lore.service';
import { TemplateService } from '../../services/template.service';
import { PageService } from '../../services/page.service';
@@ -36,7 +37,7 @@ import { ConfirmDialogService } from '../../shared/confirm-dialog/confirm-dialog
*/
@Component({
selector: 'app-page-edit',
imports: [FormsModule, RouterLink, LucideAngularModule, ChipsInputComponent, LoreLinkPickerComponent, BreadcrumbComponent, AiChatDrawerComponent, ImageGalleryComponent],
imports: [FormsModule, RouterLink, LucideAngularModule, TranslatePipe, ChipsInputComponent, LoreLinkPickerComponent, BreadcrumbComponent, AiChatDrawerComponent, ImageGalleryComponent],
templateUrl: './page-edit.component.html',
styleUrls: ['./page-edit.component.scss']
})
@@ -81,13 +82,9 @@ export class PageEditComponent implements OnInit, OnDestroy {
/** Phase b5 — drawer chat IA (conversationnel). */
chatOpen = false;
/** Action primaire dans le chat : déclenche le one-shot b4 (remplissage automatique). */
readonly chatPrimaryAction: ChatPrimaryAction = { label: 'Remplir automatiquement tous les champs' };
readonly chatPrimaryAction: ChatPrimaryAction;
/** Suggestions rapides hardcodées (MVP). */
readonly chatQuickSuggestions: string[] = [
"Étoffe l'histoire de cette page",
'Suggère des liens avec d\'autres pages du Lore',
'Propose une intrigue secondaire'
];
readonly chatQuickSuggestions: string[];
constructor(
private route: ActivatedRoute,
@@ -97,8 +94,16 @@ export class PageEditComponent implements OnInit, OnDestroy {
private pageService: PageService,
private layoutService: LayoutService,
private pageTitleService: PageTitleService,
private confirmDialog: ConfirmDialogService
) {}
private confirmDialog: ConfirmDialogService,
private translate: TranslateService
) {
this.chatPrimaryAction = { label: this.translate.instant('pageEdit.chatPrimaryAction') };
this.chatQuickSuggestions = [
this.translate.instant('pageEdit.chatSuggestion1'),
this.translate.instant('pageEdit.chatSuggestion2'),
this.translate.instant('pageEdit.chatSuggestion3')
];
}
ngOnInit(): void {
this.loreId = this.route.snapshot.paramMap.get('loreId')!;
@@ -267,8 +272,8 @@ export class PageEditComponent implements OnInit, OnDestroy {
error: (err) => {
this.aiLoading = false;
this.aiError = err?.status === 502
? "L'assistant IA est injoignable. V\u00e9rifiez que le service Brain tourne."
: "\u00c9chec de la g\u00e9n\u00e9ration IA. R\u00e9essayez dans un instant.";
? this.translate.instant('pageEdit.aiUnreachable')
: this.translate.instant('pageEdit.aiFailed');
}
});
}
@@ -293,9 +298,9 @@ export class PageEditComponent implements OnInit, OnDestroy {
delete(): void {
if (!this.page) return;
this.confirmDialog.confirm({
title: 'Supprimer la page',
message: `Supprimer la page "${this.page.title}" ?`,
confirmLabel: 'Supprimer',
title: this.translate.instant('pageEdit.deleteTitle'),
message: this.translate.instant('pageEdit.deleteMessage', { title: this.page.title }),
confirmLabel: this.translate.instant('common.delete'),
variant: 'danger'
}).then(ok => {
if (!ok || !this.page) return;