From 13437c825ff609b8741f5337a0eed19e44356750 Mon Sep 17 00:00:00 2001 From: Xylight Date: Tue, 4 Jun 2024 12:17:35 -0700 Subject: [PATCH] i18n: localize remove modal --- .../lemmy/moderation/RemoveModal.svelte | 37 ++++++++++--------- src/lib/i18n/en.json | 12 ++++++ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/lib/components/lemmy/moderation/RemoveModal.svelte b/src/lib/components/lemmy/moderation/RemoveModal.svelte index 4989d8cc..9d7dbbb4 100644 --- a/src/lib/components/lemmy/moderation/RemoveModal.svelte +++ b/src/lib/components/lemmy/moderation/RemoveModal.svelte @@ -14,6 +14,7 @@ import { fullCommunityName } from '$lib/util.js' import { amMod, isAdmin } from './moderation' import { Button, Checkbox, Modal } from 'mono-svelte' + import { t } from '$lib/translations' export let open: boolean export let item: PostView | CommentView | undefined = undefined @@ -68,7 +69,7 @@ } toast({ - content: 'Successfully purged that submission.', + content: $t('moderation.removeSubmission.successPurge'), type: 'success', }) @@ -81,7 +82,7 @@ if (commentReason) { if (replyReason == '') { toast({ - content: 'Your reply cannot be empty if "Reply reason" is enabled.', + content: $t('moderation.removeSubmission.failEmptyReply'), }) return } @@ -96,7 +97,7 @@ }) .catch(() => { toast({ - content: 'Failed to message user. Removing anyway...', + content: $t('moderation.removeSubmission.failMessage'), type: 'warning', }) }) @@ -109,7 +110,7 @@ }) .catch(() => { toast({ - content: 'Failed to post reply. Removing anyway...', + content: $t('moderation.removeSubmission.failReply'), type: 'warning', }) }) @@ -134,13 +135,6 @@ } open = false - - toast({ - content: `Successfully ${ - removed ? 'restored' : 'removed' - } that submission.`, - type: 'success', - }) } catch (err) { toast({ content: err as any, @@ -166,7 +160,11 @@ - {purge ? 'Purging' : removed ? 'Restoring' : 'Removing'} submission + {purge + ? $t('moderation.removeSubmission.titlePurge') + : removed + ? $t('moderation.removeSubmission.titleRestore') + : $t('moderation.removeSubmission.title')} {#if item}
{#if !removed && $profile?.user && (amMod($profile.user, item.community) || (isAdmin($profile.user) && item.community.local))} - Reply with reason + + {$t('moderation.removeSubmission.withReason')} + {#if commentReason}
- Reply + {$t('comment.reply')}