fix(i18n): translate comment timestamps and edited label
Some checks failed
CI / Backend Unit Tests (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
CI / Unit & Component Tests (push) Has been cancelled
CI / Unit & Component Tests (pull_request) Has been cancelled
CI / Backend Unit Tests (pull_request) Has been cancelled
CI / E2E Tests (pull_request) Has been cancelled

Replace hardcoded German strings in CommentThread.timeAgo() with
Paraglide i18n keys: comment_time_just_now, comment_time_minutes,
comment_time_hours, comment_time_days.

Update comment_edited_label from "· bearbeitet" to "(Bearbeitet)"
for the new single-timestamp design. All three languages: de/en/es.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-05 22:09:26 +02:00
parent cab017a2ce
commit 193bd73af1
4 changed files with 20 additions and 8 deletions

View File

@@ -318,7 +318,11 @@
"comment_placeholder": "Kommentar schreiben…", "comment_placeholder": "Kommentar schreiben…",
"comment_btn_post": "Senden", "comment_btn_post": "Senden",
"comment_btn_reply": "Antworten", "comment_btn_reply": "Antworten",
"comment_edited_label": "· bearbeitet", "comment_edited_label": "(Bearbeitet)",
"comment_time_just_now": "gerade eben",
"comment_time_minutes": "vor {count} Minute(n)",
"comment_time_hours": "vor {count} Stunde(n)",
"comment_time_days": "vor {count} Tag(en)",
"comment_panel_title": "Kommentare", "comment_panel_title": "Kommentare",
"comment_panel_close": "Schließen", "comment_panel_close": "Schließen",
"doc_panel_tab_metadata": "Metadaten", "doc_panel_tab_metadata": "Metadaten",

View File

@@ -318,7 +318,11 @@
"comment_placeholder": "Write a comment…", "comment_placeholder": "Write a comment…",
"comment_btn_post": "Send", "comment_btn_post": "Send",
"comment_btn_reply": "Reply", "comment_btn_reply": "Reply",
"comment_edited_label": "· edited", "comment_edited_label": "(Edited)",
"comment_time_just_now": "just now",
"comment_time_minutes": "{count} minute(s) ago",
"comment_time_hours": "{count} hour(s) ago",
"comment_time_days": "{count} day(s) ago",
"comment_panel_title": "Comments", "comment_panel_title": "Comments",
"comment_panel_close": "Close", "comment_panel_close": "Close",
"doc_panel_tab_metadata": "Metadata", "doc_panel_tab_metadata": "Metadata",

View File

@@ -318,7 +318,11 @@
"comment_placeholder": "Escribe un comentario…", "comment_placeholder": "Escribe un comentario…",
"comment_btn_post": "Enviar", "comment_btn_post": "Enviar",
"comment_btn_reply": "Responder", "comment_btn_reply": "Responder",
"comment_edited_label": "· editado", "comment_edited_label": "(Editado)",
"comment_time_just_now": "justo ahora",
"comment_time_minutes": "hace {count} minuto(s)",
"comment_time_hours": "hace {count} hora(s)",
"comment_time_days": "hace {count} día(s)",
"comment_panel_title": "Comentarios", "comment_panel_title": "Comentarios",
"comment_panel_close": "Cerrar", "comment_panel_close": "Cerrar",
"doc_panel_tab_metadata": "Metadatos", "doc_panel_tab_metadata": "Metadatos",

View File

@@ -66,12 +66,12 @@ $effect(() => {
function timeAgo(iso: string): string { function timeAgo(iso: string): string {
const diff = Date.now() - new Date(iso).getTime(); const diff = Date.now() - new Date(iso).getTime();
const minutes = Math.floor(diff / 60000); const minutes = Math.floor(diff / 60000);
if (minutes < 1) return 'gerade eben'; if (minutes < 1) return m.comment_time_just_now();
if (minutes < 60) return `vor ${minutes} Minute${minutes === 1 ? '' : 'n'}`; if (minutes < 60) return m.comment_time_minutes({ count: minutes });
const hours = Math.floor(minutes / 60); const hours = Math.floor(minutes / 60);
if (hours < 24) return `vor ${hours} Stunde${hours === 1 ? '' : 'n'}`; if (hours < 24) return m.comment_time_hours({ count: hours });
const days = Math.floor(hours / 24); const days = Math.floor(hours / 24);
return `vor ${days} Tag${days === 1 ? '' : 'en'}`; return m.comment_time_days({ count: days });
} }
function wasEdited(c: { createdAt: string; updatedAt: string }): boolean { function wasEdited(c: { createdAt: string; updatedAt: string }): boolean {
@@ -261,7 +261,7 @@ onMount(async () => {
<span class="font-sans text-xs font-semibold text-ink">{comment.authorName}</span> <span class="font-sans text-xs font-semibold text-ink">{comment.authorName}</span>
{#if wasEdited(comment)} {#if wasEdited(comment)}
<span class="font-sans text-xs text-ink-3" <span class="font-sans text-xs text-ink-3"
>{timeAgo(comment.updatedAt)} (Bearbeitet)</span >{timeAgo(comment.updatedAt)} {m.comment_edited_label()}</span
> >
{:else} {:else}
<span class="font-sans text-xs text-ink-3">{timeAgo(comment.createdAt)}</span> <span class="font-sans text-xs text-ink-3">{timeAgo(comment.createdAt)}</span>