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

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