feat(training): add Paraglide i18n to training UI components and wire SegmentationTrainingCard

- Convert TrainingHistory, OcrTrainingCard, SegmentationTrainingCard, and
  TranscriptionBlock "Nur Segmentierung" badge to use Paraglide message keys
- Add availableSegBlocks to TrainingInfoResponse to expose segmentation
  block count in the training info endpoint
- Wire SegmentationTrainingCard into admin/system page below OCR training card
- Update api.ts with availableSegBlocks field

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-13 15:14:27 +02:00
parent 4e08d31e01
commit 86e9c05aaf
9 changed files with 144 additions and 25 deletions

View File

@@ -1,4 +1,6 @@
<script lang="ts">
import { m } from '$lib/paraglide/messages.js';
interface Run {
id: string;
status: 'RUNNING' | 'DONE' | 'FAILED';
@@ -31,17 +33,17 @@ function formatDate(iso: string): string {
<table class="w-full text-sm">
<thead>
<tr class="border-b border-line text-xs font-bold tracking-widest text-ink-3 uppercase">
<th class="pb-2 text-left">Datum</th>
<th class="pb-2 text-left">Status</th>
<th class="pb-2 text-right">Blöcke</th>
<th class="hidden pb-2 text-right md:table-cell">Dokumente</th>
<th class="pb-2 text-left">{m.training_history_col_date()}</th>
<th class="pb-2 text-left">{m.training_history_col_status()}</th>
<th class="pb-2 text-right">{m.training_history_col_blocks()}</th>
<th class="hidden pb-2 text-right md:table-cell">{m.training_history_col_docs()}</th>
</tr>
</thead>
<tbody>
{#if runs.length === 0}
<tr>
<td colspan="4" class="py-4 text-center text-sm text-ink-2">
Noch keine Trainings-Läufe.
{m.training_history_empty()}
</td>
</tr>
{:else}
@@ -52,18 +54,18 @@ function formatDate(iso: string): string {
{#if run.status === 'DONE'}
<span
class="inline-flex items-center gap-1 rounded-sm bg-green-100 px-1.5 py-0.5 text-xs font-medium text-green-700"
>Fertig</span
>{m.training_status_done()}</span
>
{:else if run.status === 'FAILED'}
<span
class="inline-flex items-center gap-1 rounded-sm bg-red-100 px-1.5 py-0.5 text-xs font-medium text-red-700"
title={run.errorMessage}> Fehler</span
title={run.errorMessage}> {m.training_status_failed()}</span
>
{:else}
<span
class="inline-flex items-center gap-1 rounded-sm bg-yellow-100 px-1.5 py-0.5 text-xs font-medium text-yellow-700"
><span class="h-1.5 w-1.5 animate-pulse rounded-full bg-yellow-500"
></span>Läuft…</span
></span>{m.training_status_running()}</span
>
{/if}
</td>