i18n: localize ban modal

This commit is contained in:
Xylight committed 2024-06-04 11:55:51 -07:00
1 parent 0066e2da2e
commit 76a0fa0495
2 files changed
+27 -16

No files matched your search

@@ -6,6 +6,8 @@
import { profile } from '$lib/auth.js'
import { Button, Checkbox, Modal, TextInput } from 'mono-svelte'
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
import { t } from '$lib/translations'
import CommunityLink from '../community/CommunityLink.svelte'
export let open = false
let item: Person | undefined
@@ -101,42 +103,38 @@
</script>
<Modal bind:open class="max-w-xl w-full">
<h1 slot="title">{banned ? 'Unbanning' : 'Banning'} user</h1>
<h1 slot="title">
{banned ? $t('moderation.ban.unbanning') : $t('moderation.ban.banning')}
</h1>
{#if item}
<form class="flex flex-col gap-4" on:submit|preventDefault={submit}>
<div class="flex items-center gap-1">
<Avatar url={item.avatar} alt={item.name} width={24} />
<span class="font-bold">{item.name}</span>
</div>
<p>
{banned ? 'Unbanning' : 'Banning'} from
<span class="font-bold">{community ? community.name : 'site'}</span>
</p>
{#if community}
<CommunityLink {community} avatar />
{/if}
<MarkdownEditor
required
bind:value={reason}
label="Reason"
placeholder="Why are you {banned
? 'unbanning'
: 'banning'} {item.name}?"
label={$t('moderation.reason')}
/>
{#if !banned}
<Checkbox bind:checked={deleteData}>
Delete data
{$t('moderation.ban.deleteData')}
<svelte:fragment slot="description">
This will delete ALL of this user's posts and comments on this {community
? 'community'
: 'site'}.
{$t('moderation.ban.warning')}
</svelte:fragment>
</Checkbox>
<TextInput
bind:value={expires}
label="Expires (UTC)"
label={$t('moderation.ban.expires')}
placeholder="2024 August 5"
/>
{/if}
<Button submit color="primary" {loading} disabled={loading} size="lg">
Submit
{$t('form.submit')}
</Button>
</form>
{/if}