i18n: localize community page
This commit is contained in:
1 parent
7c257dca9d
commit
d7a4c0e29e
2 files changed
+18
-8
No files matched your search
@@ -8,6 +8,7 @@
|
|||||||
import { Button, Checkbox, TextInput } from 'mono-svelte'
|
import { Button, Checkbox, TextInput } from 'mono-svelte'
|
||||||
import { uploadImage } from '$lib/util.js'
|
import { uploadImage } from '$lib/util.js'
|
||||||
import { t } from '$lib/translations'
|
import { t } from '$lib/translations'
|
||||||
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The community ID to edit.
|
* The community ID to edit.
|
||||||
@@ -107,23 +108,31 @@
|
|||||||
|
|
||||||
<form on:submit|preventDefault={submit} class="flex flex-col gap-4 h-full">
|
<form on:submit|preventDefault={submit} class="flex flex-col gap-4 h-full">
|
||||||
<slot name="formtitle">
|
<slot name="formtitle">
|
||||||
<h1 class="text-2xl font-bold">Create Community</h1>
|
<Header>{$t('routes.createCommunity')}</Header>
|
||||||
</slot>
|
</slot>
|
||||||
<TextInput
|
<TextInput
|
||||||
required
|
required
|
||||||
label="Name"
|
label={$t('form.name')}
|
||||||
bind:value={formData.name}
|
bind:value={formData.name}
|
||||||
on:input={() => {
|
on:input={() => {
|
||||||
formData.name = formData.name.toLowerCase().replaceAll(' ', '_')
|
formData.name = formData.name.toLowerCase().replaceAll(' ', '_')
|
||||||
}}
|
}}
|
||||||
disabled={edit != undefined}
|
disabled={edit != undefined}
|
||||||
/>
|
/>
|
||||||
<TextInput required label="Display name" bind:value={formData.displayName} />
|
<TextInput
|
||||||
<ImageInput label="Icon" bind:files={formData.icon} />
|
required
|
||||||
<ImageInput label="Banner" bind:files={formData.banner} />
|
label={$t('form.profile.displayName')}
|
||||||
<MarkdownEditor previewButton label="Sidebar" bind:value={formData.sidebar} />
|
bind:value={formData.displayName}
|
||||||
|
/>
|
||||||
|
<ImageInput label={$t('form.profile.avatar')} bind:files={formData.icon} />
|
||||||
|
<ImageInput label={$t('form.profile.banner')} bind:files={formData.banner} />
|
||||||
|
<MarkdownEditor
|
||||||
|
previewButton
|
||||||
|
label={$t('routes.admin.config.banner')}
|
||||||
|
bind:value={formData.sidebar}
|
||||||
|
/>
|
||||||
|
|
||||||
<Checkbox bind:checked={formData.nsfw}>NSFW</Checkbox>
|
<Checkbox bind:checked={formData.nsfw}>{$t('post.badges.nsfw')}</Checkbox>
|
||||||
<Checkbox bind:checked={formData.postsLockedToModerators}>
|
<Checkbox bind:checked={formData.postsLockedToModerators}>
|
||||||
Only moderators can post
|
Only moderators can post
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
@@ -135,6 +144,6 @@
|
|||||||
loading={formData.submitting}
|
loading={formData.submitting}
|
||||||
disabled={formData.submitting}
|
disabled={formData.submitting}
|
||||||
>
|
>
|
||||||
{edit ? 'Save' : 'Create'}
|
{edit ? $t('common.save') : $t('form.submit')}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
@@ -197,6 +197,7 @@
|
|||||||
},
|
},
|
||||||
"saved": "Saved",
|
"saved": "Saved",
|
||||||
"createPost": "Create Post",
|
"createPost": "Create Post",
|
||||||
|
"createCommunity": "Create Community",
|
||||||
"post": {
|
"post": {
|
||||||
"crosspostCount": "crossposts",
|
"crosspostCount": "crossposts",
|
||||||
"commentCount": "comments",
|
"commentCount": "comments",
|
||||||
|
|||||||
Reference in new issue
Block a user