feat(lesereisen): implement lesereisen
All checks were successful
CI / Unit & Component Tests (push) Successful in 4m34s
CI / OCR Service Tests (push) Successful in 27s
CI / Backend Unit Tests (push) Successful in 5m1s
CI / fail2ban Regex (push) Successful in 47s
CI / Semgrep Security Scan (push) Successful in 23s
CI / Compose Bucket Idempotency (push) Successful in 1m11s

This commit was merged in pull request #787.
This commit is contained in:
2026-06-12 14:04:02 +02:00
parent 4bcf568ed4
commit b33d0eb850
142 changed files with 11643 additions and 917 deletions

View File

@@ -1,4 +1,5 @@
import { formatDate } from '$lib/shared/utils/date';
import { m } from '$lib/paraglide/messages.js';
type Person = { firstName?: string | null; lastName: string; displayName: string };
type DocForMeta = {
@@ -17,6 +18,19 @@ function djb2(str: string): number {
return Math.abs(hash);
}
/** Localized fallback when a person has no name parts. */
export function unknownPersonName(): string {
return m.person_unknown();
}
/**
* Single source for the join-names-or-fallback rule. Mirrors the server-side
* fallback in GeschichteService.toView (which emits the literal '[Unbekannt]').
*/
export function joinNameOrUnknown(firstName?: string | null, lastName?: string | null): string {
return [firstName, lastName].filter(Boolean).join(' ').trim() || unknownPersonName();
}
export function getInitials(name: string): string {
const words = name.trim().split(/\s+/).filter(Boolean);
if (words.length === 0) return '';