feat(frontend): add precision-aware document date formatter

Adds formatDocumentDate — a pure, branch-per-precision label function that
renders a document date at exactly the precision the data claims (DAY → full
date, MONTH → "Juni 1916", SEASON → localized season word, YEAR → "1916",
APPROX → "ca. 1916", RANGE with collapse/expand/open-ended, UNKNOWN → "Datum
unbekannt"). Delegates to the existing date.ts helpers (shared T12:00:00
convention) and routes every localized word through Paraglide.

A shared docs/date-label-fixtures.json table is asserted by this spec and will
be asserted by the Java title formatter, as the drift guard requested in
review (Markus/Sara). Adds de/en/es precision/season/edit-form i18n keys.

Assumption: SEASON structured label is localized per locale (Decision 4),
with the verbatim raw cell preserved as a separate secondary line by callers.

Refs #666

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-27 11:43:32 +02:00
parent e4a154406e
commit f2a74a6064
6 changed files with 419 additions and 0 deletions

View File

@@ -261,6 +261,24 @@
"doc_preview_iframe_title": "Dokumentvorschau",
"doc_image_alt": "Original-Scan",
"doc_no_date": "Kein Datum",
"date_precision_unknown": "Datum unbekannt",
"date_precision_approx_prefix": "ca.",
"date_range_open_prefix": "ab",
"date_season_spring": "Frühling",
"date_season_summer": "Sommer",
"date_season_autumn": "Herbst",
"date_season_winter": "Winter",
"date_original_label": "Originaltext:",
"date_unknown_icon_label": "Datum unbekannt",
"form_label_date_precision": "Datumsgenauigkeit",
"form_label_date_end": "Enddatum",
"date_precision_option_day": "Genauer Tag",
"date_precision_option_month": "Monat",
"date_precision_option_season": "Jahreszeit",
"date_precision_option_year": "Jahr",
"date_precision_option_range": "Zeitraum",
"date_precision_option_approx": "Ungefähr",
"date_precision_option_unknown": "Unbekannt",
"person_merge_will_be_deleted": "wird gelöscht.",
"comp_typeahead_placeholder": "Namen tippen...",
"comp_typeahead_loading": "Suche...",