From a421093a232cfeffd8869717a29edb7a6e93c066 Mon Sep 17 00:00:00 2001 From: Xylight Date: Mon, 3 Jun 2024 16:38:24 -0700 Subject: [PATCH] i18n: localize comments --- .../components/lemmy/comment/Comment.svelte | 7 ++++--- .../lemmy/comment/CommentActions.svelte | 21 ++++++++++++------- src/lib/i18n/en.json | 7 +++++++ 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/lib/components/lemmy/comment/Comment.svelte b/src/lib/components/lemmy/comment/Comment.svelte index 2b09322f..0a98af0e 100644 --- a/src/lib/components/lemmy/comment/Comment.svelte +++ b/src/lib/components/lemmy/comment/Comment.svelte @@ -22,6 +22,7 @@ import ShieldIcon from '../moderation/ShieldIcon.svelte' import { page } from '$app/stores' import { onMount } from 'svelte' + import { t } from '$lib/translations' export let node: CommentNodeI export let postId: number @@ -145,7 +146,7 @@ src={Trash} solid size="12" - title="Deleted" + title={$t('post.badges.deleted')} class="text-red-600 dark:text-red-500" /> {/if} @@ -154,7 +155,7 @@ src={Bookmark} solid size="12" - title="Saved" + title={$t('post.badges.saved')} class="text-yellow-600 dark:text-yellow-500" /> {/if} @@ -181,7 +182,7 @@
-

Reply

+

{$t('comment.reply')}

- Actions + {$t('comment.actions.label')} { navigator.share?.({ @@ -76,13 +77,13 @@ }} > - Copy Link +
{$t('comment.actions.link')}
{#if $profile?.jwt} {#if comment.creator.id == $profile.user?.local_user_view.person.id} dispatcher('edit', comment)}> - Edit + {$t('post.actions.more.edit')} {/if} - {comment.saved ? 'Unsave' : 'Save'} + + {comment.saved ? $t('post.actions.unsave') : $t('post.actions.save')} + {#if $profile?.user && $profile.jwt && $profile.user.local_user_view.person.id == comment.creator.id} - {comment.comment.deleted ? 'Restore' : 'Delete'} + + {comment.comment.deleted + ? $t('post.actions.more.restore') + : $t('post.actions.more.delete')} + {/if} {#if $profile.jwt && $profile.user?.local_user_view.person.id != comment.creator.id} report(comment)} color="danger-subtle"> - Report + {$t('moderation.report')} {/if} {/if} diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index 80fdcee1..1aacd60a 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -177,6 +177,13 @@ "saved": "Saved" } }, + "comment": { + "reply": "Reply", + "actions": { + "label": "Actions", + "link": "Copy Link" + } + }, "moderation": { "report": "Report" },