i18n: localize admin config page
This commit is contained in:
1 parent
0493c44344
commit
62901081ab
4 files changed
+147
-69
No files matched your search
+49
-1
@@ -162,7 +162,8 @@
|
|||||||
"description": "This instance has registrations closed. Find another instance.",
|
"description": "This instance has registrations closed. Find another instance.",
|
||||||
"anotherInstance": "Find another instance"
|
"anotherInstance": "Find another instance"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"description": "Description"
|
||||||
},
|
},
|
||||||
"routes": {
|
"routes": {
|
||||||
"frontpage": {
|
"frontpage": {
|
||||||
@@ -229,6 +230,53 @@
|
|||||||
"resolve": "Resolve",
|
"resolve": "Resolve",
|
||||||
"unresolve": "Unresolve"
|
"unresolve": "Unresolve"
|
||||||
},
|
},
|
||||||
|
"admin": {
|
||||||
|
"title": "Administration",
|
||||||
|
"config": {
|
||||||
|
"title": "Configuration",
|
||||||
|
"sidebar": "Sidebar",
|
||||||
|
"icon": "Icon",
|
||||||
|
"banner": "Banner",
|
||||||
|
"downvotesEnabled": "Enable Downvotes",
|
||||||
|
"nsfwEnabled": "Enable NSFW",
|
||||||
|
"registration": {
|
||||||
|
"label": "Registration Mode",
|
||||||
|
"open": "Open",
|
||||||
|
"application": "Require Application",
|
||||||
|
"closed": "Closed"
|
||||||
|
},
|
||||||
|
"applicationQuestion": "Application Question",
|
||||||
|
"adminCommunityOnly": "Only admins can create communities",
|
||||||
|
"requireVerifyEmail": "Require email verification",
|
||||||
|
"emailAdminsOnApplication": "Email admins on receiving new applications",
|
||||||
|
"emailAdminsOnReport": "Email admins on receiving new reports",
|
||||||
|
"listingType": {
|
||||||
|
"label": "Listing Type",
|
||||||
|
"all": "All",
|
||||||
|
"local": "Local"
|
||||||
|
},
|
||||||
|
"private": "Private instance",
|
||||||
|
"hideModlogModNames": "Hide modlog mod names",
|
||||||
|
"slurFilter": "Slur filter regex",
|
||||||
|
"federation": "Federation enabled",
|
||||||
|
"federationDebug": "Federation debug mode",
|
||||||
|
"captcha": {
|
||||||
|
"enabled": "Enabled"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"applications": {
|
||||||
|
"title": "Applications"
|
||||||
|
},
|
||||||
|
"taglines": {
|
||||||
|
"title": "Taglines"
|
||||||
|
},
|
||||||
|
"team": {
|
||||||
|
"title": "Team"
|
||||||
|
},
|
||||||
|
"federation": {
|
||||||
|
"title": "Federation"
|
||||||
|
}
|
||||||
|
},
|
||||||
"verifyEmail": {
|
"verifyEmail": {
|
||||||
"message": "Your email was verified. You can now close this window.",
|
"message": "Your email was verified. You can now close this window.",
|
||||||
"error": "Failed to verify your email."
|
"error": "Failed to verify your email."
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import { page } from '$app/stores'
|
import { page } from '$app/stores'
|
||||||
import { profile } from '$lib/auth'
|
import { profile } from '$lib/auth'
|
||||||
import MultiSelect from '$lib/components/input/Switch.svelte'
|
import MultiSelect from '$lib/components/input/Switch.svelte'
|
||||||
|
import { t } from '$lib/translations'
|
||||||
import { Badge } from 'mono-svelte'
|
import { Badge } from 'mono-svelte'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -24,11 +25,11 @@
|
|||||||
'/admin/federation',
|
'/admin/federation',
|
||||||
]}
|
]}
|
||||||
optionNames={[
|
optionNames={[
|
||||||
'Configuration',
|
$t('routes.admin.config.title'),
|
||||||
'Applications',
|
$t('routes.admin.applications.title'),
|
||||||
'Taglines',
|
$t('routes.admin.taglines.title'),
|
||||||
'Team',
|
$t('routes.admin.team.title'),
|
||||||
'Federation',
|
$t('routes.admin.federation.title'),
|
||||||
]}
|
]}
|
||||||
selected={$page.url.pathname}
|
selected={$page.url.pathname}
|
||||||
on:select={(e) => {
|
on:select={(e) => {
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { profile } from '$lib/auth.js'
|
import { profile } from '$lib/auth.js'
|
||||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||||
import { Label, toast } from 'mono-svelte'
|
import { Label, Switch, toast } from 'mono-svelte'
|
||||||
import { getClient } from '$lib/lemmy.js'
|
import { getClient } from '$lib/lemmy.js'
|
||||||
import type { EditSite } from 'lemmy-js-client'
|
import type { EditSite } from 'lemmy-js-client'
|
||||||
import type { PageData } from './$types.js'
|
import type { PageData } from './$types.js'
|
||||||
import { Button, Checkbox, Select, TextInput } from 'mono-svelte'
|
import { Button, Checkbox, Select, TextInput } from 'mono-svelte'
|
||||||
import ImageUploadModal from '$lib/components/lemmy/modal/ImageUploadModal.svelte';
|
import ImageUploadModal from '$lib/components/lemmy/modal/ImageUploadModal.svelte'
|
||||||
import { DocumentPlus, Icon } from 'svelte-hero-icons';
|
import { DocumentPlus, Icon } from 'svelte-hero-icons'
|
||||||
|
import { t } from '$lib/translations.js'
|
||||||
|
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||||
|
|
||||||
export let data: PageData
|
export let data: PageData
|
||||||
|
|
||||||
@@ -46,136 +48,163 @@
|
|||||||
|
|
||||||
let uploading = {
|
let uploading = {
|
||||||
icon: false,
|
icon: false,
|
||||||
banner: false
|
banner: false,
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<title>Administration</title>
|
<title>{$t('routes.admin.title')}</title>
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<form class="flex flex-col gap-4" on:submit|preventDefault={save}>
|
<form class="flex flex-col gap-4" on:submit|preventDefault={save}>
|
||||||
<h1 class="font-bold text-2xl">Site configuration</h1>
|
<Header>{$t('routes.admin.config.title')}</Header>
|
||||||
{#if formData}
|
{#if formData}
|
||||||
<TextInput bind:value={formData.name} label="Name" />
|
<TextInput bind:value={formData.name} label={$t('form.name')} />
|
||||||
<TextInput bind:value={formData.description} label="Description" />
|
<TextInput
|
||||||
|
bind:value={formData.description}
|
||||||
|
label={$t('form.description')}
|
||||||
|
/>
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
previewButton
|
previewButton
|
||||||
bind:value={formData.sidebar}
|
bind:value={formData.sidebar}
|
||||||
label="Sidebar"
|
label={$t('routes.admin.config.sidebar')}
|
||||||
/>
|
/>
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
previewButton
|
previewButton
|
||||||
bind:value={formData.legal_information}
|
bind:value={formData.legal_information}
|
||||||
label="Legal"
|
label={$t('routes.legal.title')}
|
||||||
/>
|
/>
|
||||||
<div class="flex flex-col gap-1">
|
<div class="flex flex-col gap-1">
|
||||||
<Label>Icon</Label>
|
<Label>{$t('routes.admin.config.icon')}</Label>
|
||||||
<button type="button" on:click={() => uploading.icon = !uploading.icon} class="flex flex-col gap-4 bg-white dark:bg-black border border-slate-300 dark:border-zinc-800 p-4 w-full h-32 rounded-xl">
|
<button
|
||||||
|
type="button"
|
||||||
|
on:click={() => (uploading.icon = !uploading.icon)}
|
||||||
|
class="flex flex-col gap-4 bg-white dark:bg-black border border-slate-300 dark:border-zinc-800 p-4 w-full h-32 rounded-xl"
|
||||||
|
>
|
||||||
{#if formData.icon}
|
{#if formData.icon}
|
||||||
<img src={formData.icon} class="rounded-md mx-auto h-full" />
|
<img src={formData.icon} class="rounded-md mx-auto h-full" />
|
||||||
{:else}
|
{:else}
|
||||||
<Icon src={DocumentPlus} size="48" class="text-slate-500 dark:text-zinc-500 mx-auto my-auto" />
|
<Icon
|
||||||
|
src={DocumentPlus}
|
||||||
|
size="48"
|
||||||
|
class="text-slate-500 dark:text-zinc-500 mx-auto my-auto"
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
{#if uploading.icon}
|
{#if uploading.icon}
|
||||||
<ImageUploadModal
|
<ImageUploadModal
|
||||||
bind:open={uploading.icon}
|
bind:open={uploading.icon}
|
||||||
bind:output={formData.icon}
|
bind:output={formData.icon}
|
||||||
on:upload={() => uploading.icon = false}
|
on:upload={() => (uploading.icon = false)}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1">
|
<div class="flex flex-col gap-1">
|
||||||
<Label>Banner</Label>
|
<Label>{$t('routes.admin.config.banner')}</Label>
|
||||||
<button type="button" on:click={() => uploading.banner = !uploading.banner} class="flex flex-col gap-4 bg-white dark:bg-black border border-slate-300 dark:border-zinc-800 p-4 w-full h-32 rounded-xl">
|
<button
|
||||||
|
type="button"
|
||||||
|
on:click={() => (uploading.banner = !uploading.banner)}
|
||||||
|
class="flex flex-col gap-4 bg-white dark:bg-black border border-slate-300 dark:border-zinc-800 p-4 w-full h-32 rounded-xl"
|
||||||
|
>
|
||||||
{#if formData.banner}
|
{#if formData.banner}
|
||||||
<img src={formData.banner} class="rounded-md mx-auto h-full" />
|
<img src={formData.banner} class="rounded-md mx-auto h-full" />
|
||||||
{:else}
|
{:else}
|
||||||
<Icon src={DocumentPlus} size="48" class="text-slate-500 dark:text-zinc-500 mx-auto my-auto" />
|
<Icon
|
||||||
|
src={DocumentPlus}
|
||||||
|
size="48"
|
||||||
|
class="text-slate-500 dark:text-zinc-500 mx-auto my-auto"
|
||||||
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</button>
|
</button>
|
||||||
{#if uploading.banner}
|
{#if uploading.banner}
|
||||||
<ImageUploadModal
|
<ImageUploadModal
|
||||||
bind:open={uploading.banner}
|
bind:open={uploading.banner}
|
||||||
bind:output={formData.banner}
|
bind:output={formData.banner}
|
||||||
on:upload={() => uploading.banner = false}
|
on:upload={() => (uploading.banner = false)}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<Checkbox bind:checked={formData.enable_downvotes} defaultValue={true}>
|
<Switch bind:checked={formData.enable_downvotes} defaultValue={true}>
|
||||||
Enable downvotes
|
{$t('routes.admin.config.downvotesEnabled')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox checked={formData.enable_nsfw} defaultValue={true}>
|
<Switch checked={formData.enable_nsfw} defaultValue={true}>
|
||||||
Enable NSFW
|
{$t('routes.admin.config.nsfwEnabled')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Select
|
<Select
|
||||||
label="Registration Mode"
|
label={$t('routes.admin.config.registration.label')}
|
||||||
bind:value={formData.registration_mode}
|
bind:value={formData.registration_mode}
|
||||||
class="w-max"
|
class="w-max"
|
||||||
>
|
>
|
||||||
<option value="Open">Open</option>
|
<option value="Open">
|
||||||
<option value="RequireApplication">Require Application</option>
|
{$t('routes.admin.config.registration.open')}
|
||||||
<option value="Closed">Closed</option>
|
</option>
|
||||||
|
<option value="RequireApplication">
|
||||||
|
{$t('routes.admin.config.registration.application')}
|
||||||
|
</option>
|
||||||
|
<option value="Closed">
|
||||||
|
{$t('routes.admin.config.registration.closed')}
|
||||||
|
</option>
|
||||||
</Select>
|
</Select>
|
||||||
{#if formData.registration_mode == 'RequireApplication'}
|
{#if formData.registration_mode == 'RequireApplication'}
|
||||||
<MarkdownEditor
|
<MarkdownEditor
|
||||||
previewButton
|
previewButton
|
||||||
label="Application question"
|
label={$t('routes.admin.config.applicationQuestion')}
|
||||||
bind:value={formData.application_question}
|
bind:value={formData.application_question}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
<Checkbox
|
<Switch
|
||||||
bind:checked={formData.community_creation_admin_only}
|
bind:checked={formData.community_creation_admin_only}
|
||||||
defaultValue={true}
|
defaultValue={true}
|
||||||
>
|
>
|
||||||
Only admins can create communities
|
{$t('routes.admin.config.adminCommunityOnly')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox
|
<Switch
|
||||||
bind:checked={formData.require_email_verification}
|
bind:checked={formData.require_email_verification}
|
||||||
defaultValue={true}
|
defaultValue={true}
|
||||||
>
|
>
|
||||||
Require email verification
|
{$t('routes.admin.config.requireVerifyEmail')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox
|
<Switch
|
||||||
bind:checked={formData.application_email_admins}
|
bind:checked={formData.application_email_admins}
|
||||||
defaultValue={true}
|
defaultValue={true}
|
||||||
>
|
>
|
||||||
Email admins on receiving new applications
|
{$t('routes.admin.config.emailAdminsOnApplication')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={formData.reports_email_admins} defaultValue={true}>
|
<Switch bind:checked={formData.reports_email_admins} defaultValue={true}>
|
||||||
Email admins on receiving new reports
|
{$t('routes.admin.config.emailAdminsOnReport')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Select
|
<Select
|
||||||
label="Listing Type"
|
label={$t('routes.admin.config.listingType.label')}
|
||||||
bind:value={formData.default_post_listing_type}
|
bind:value={formData.default_post_listing_type}
|
||||||
class="w-max"
|
class="w-max"
|
||||||
>
|
>
|
||||||
<option value="All">All</option>
|
<option value="All">{$t('routes.admin.config.listingType.all')}</option>
|
||||||
<option value="Local">Local</option>
|
<option value="Local">
|
||||||
|
{$t('routes.admin.config.listingType.local')}
|
||||||
|
</option>
|
||||||
</Select>
|
</Select>
|
||||||
<Checkbox bind:checked={formData.private_instance} defaultValue={true}>
|
<Switch bind:checked={formData.private_instance} defaultValue={true}>
|
||||||
Private instance
|
{$t('routes.admin.config.private')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={formData.hide_modlog_mod_names} defaultValue={true}>
|
<Switch bind:checked={formData.hide_modlog_mod_names} defaultValue={true}>
|
||||||
Hide modlog mod names
|
{$t('routes.admin.config.hideModlogModNames')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<TextInput
|
<TextInput
|
||||||
bind:value={formData.slur_filter_regex}
|
bind:value={formData.slur_filter_regex}
|
||||||
label="Slur filter regex"
|
label={$t('routes.admin.config.slurFilter')}
|
||||||
placeholder="(word1|word2)"
|
placeholder="(word1|word2)"
|
||||||
/>
|
/>
|
||||||
<Checkbox bind:checked={formData.federation_enabled} defaultValue={true}>
|
<Switch bind:checked={formData.federation_enabled} defaultValue={true}>
|
||||||
Federation enabled
|
{$t('routes.admin.config.federation')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={formData.federation_debug} defaultValue={false}>
|
<Switch bind:checked={formData.federation_debug} defaultValue={false}>
|
||||||
Federation debug mode
|
{$t('routes.admin.config.federationDebug')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
<Checkbox bind:checked={formData.captcha_enabled} defaultValue={false}>
|
<Switch bind:checked={formData.captcha_enabled} defaultValue={false}>
|
||||||
Captcha enabled
|
{$t('routes.admin.config.captcha.enabled')}
|
||||||
</Checkbox>
|
</Switch>
|
||||||
{/if}
|
{/if}
|
||||||
<Button color="primary" size="lg" loading={saving} disabled={saving} submit>
|
<Button color="primary" size="lg" loading={saving} disabled={saving} submit>
|
||||||
Save
|
{$t('common.save')}
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
@@ -103,8 +103,8 @@
|
|||||||
<p slot="description">
|
<p slot="description">
|
||||||
The language used for Photon's UI.
|
The language used for Photon's UI.
|
||||||
<Note>
|
<Note>
|
||||||
All languages other than US English are community translated, and may
|
All languages other than US English and Hebrew are community
|
||||||
be incomplete!
|
translated, and may be incomplete!
|
||||||
</Note>
|
</Note>
|
||||||
</p>
|
</p>
|
||||||
<Select bind:value={$userSettings.language}>
|
<Select bind:value={$userSettings.language}>
|
||||||
|
|||||||
Reference in new issue
Block a user