diff --git a/src/lib/components/lemmy/moderation/ModerationMenu.svelte b/src/lib/components/lemmy/moderation/ModerationMenu.svelte index de971033..c2f1a628 100644 --- a/src/lib/components/lemmy/moderation/ModerationMenu.svelte +++ b/src/lib/components/lemmy/moderation/ModerationMenu.svelte @@ -15,6 +15,8 @@ import { Menu, MenuButton, MenuDivider, toast } from 'mono-svelte' import { profile } from '$lib/auth.js' import { Button } from 'mono-svelte' + import { t } from '$lib/translations' + import ShieldIcon from './ShieldIcon.svelte' export let item: PostView | CommentView @@ -34,11 +36,6 @@ }) item.post.locked = lock - - toast({ - content: `Successfully ${lock ? 'locked' : 'unlocked'} that post.`, - type: 'success', - }) } catch (err) { toast({ content: err as any, @@ -62,11 +59,6 @@ }) item.post.featured_community = pinned - - toast({ - content: `Successfully ${pinned ? 'pinned' : 'unpinned'} that post.`, - type: 'success', - }) } catch (err) { toast({ content: err as any, @@ -87,26 +79,14 @@ loading={acting} {...$$restProps} > - - - + {#if ($profile?.user && amMod($profile.user, item.community)) || ($profile?.user && isAdmin($profile.user))} - Moderation {#if !item.community.local && !amMod($profile.user, item.community)} - (Instance Only) + {#if !item.community.local && !amMod($profile.user, item.community)} + {$t('moderation.labelInstanceOnly')} + {:else} + {$t('moderation.label')} {/if} - {item.post.locked ? 'Unlock' : 'Lock'} + {item.post.locked ? $t('moderation.unlock') : $t('moderation.lock')} - {item.post.featured_community ? 'Unfeature' : 'Feature'} + + {item.post.featured_community + ? $t('moderation.unfeature') + : $t('moderation.feature')} + {#if isAdmin($profile.user)} - Community + {$t('form.post.community')} {/if} remove(item)}> {#if isCommentView(item)} - {item.comment.removed ? 'Restore' : 'Remove'} + {item.comment.removed + ? $t('moderation.restore') + : $t('moderation.remove')} {:else} - {item.post.removed ? 'Restore' : 'Remove'} + {item.post.removed ? $t('moderation.restore') : $t('moderation.remove')} {/if} {#if $profile?.user && $profile.user.local_user_view.person.id != item.creator.id} @@ -157,13 +143,13 @@ > {item.creator_banned_from_community - ? 'Unban from community' - : 'Ban from community'} + ? $t('moderation.ban.unbanFromCommunity') + : $t('moderation.ban.banFromCommunity')} {/if} {/if} {#if $profile?.user && isAdmin($profile.user)} - Admin + {$t('admin.label')} @@ -173,13 +159,17 @@
- {item.post.featured_local ? 'Unfeature' : 'Feature'} - Instance + + {item.post.featured_local + ? $t('moderation.unfeature') + : $t('moderation.feature')} + + {$t('admin.instance')}
remove(item, true)}> - Purge + {$t('admin.purge')} {/if} diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index c9f2b42e..e8859f89 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -345,7 +345,9 @@ } }, "admin": { - "purge": "Purge" + "purge": "Purge", + "instance": "Instance", + "label": "Administration" }, "content": { "all": "All", @@ -397,14 +399,19 @@ "unbanning": "Unbanning User", "deleteData": "Delete data", "warning": "This will delete ALL of this user's submissions here.", - "expires": "Expires (UTC)" + "expires": "Expires (UTC)", + "banFromCommunity": "Ban from community", + "unbanFromCommunity": "Unban from community" }, "reason": "Reason", "lock": "Lock", "unlock": "Unlock", "remove": "Remove", "restore": "Restore", - "label": "Moderation" + "label": "Moderation", + "labelInstanceOnly": "Moderation (Instance Only)", + "feature": "Feature", + "unfeature": "Unfeature" }, "common": { "back": "Back",