i18n: localize taglines and team page

This commit is contained in:
Xylight committed 2024-06-04 11:34:14 -07:00
1 parent f960062603
commit c3b90d5fe9
3 files changed
+30 -24

No files matched your search

+13 -3
View File
@@ -280,10 +280,19 @@
"modalTitle": "Deny Application" "modalTitle": "Deny Application"
}, },
"taglines": { "taglines": {
"title": "Taglines" "title": "Taglines",
"add": "Add a tagline",
"empty": {
"title": "No taglines",
"description": "A random tagline will appear on the site card when users visit your instance."
}
}, },
"team": { "team": {
"title": "Team" "title": "Admins",
"empty": {
"title": "No admins",
"description": "Somehow there's no admins of this site. How??"
}
}, },
"federation": { "federation": {
"title": "Federation" "title": "Federation"
@@ -379,7 +388,8 @@
"enabled": "Enabled", "enabled": "Enabled",
"disabled": "Disabled", "disabled": "Disabled",
"enable": "Enable", "enable": "Enable",
"disable": "Disable" "disable": "Disable",
"add": "Add"
}, },
"message": { "message": {
"success": "Success", "success": "Success",
+11 -13
View File
@@ -9,6 +9,8 @@
import type { Tagline } from 'lemmy-js-client' import type { Tagline } from 'lemmy-js-client'
import { Button } from 'mono-svelte' import { Button } from 'mono-svelte'
import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons' import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/translations.js'
export let data export let data
@@ -43,7 +45,7 @@
{#if taglines.length > 0} {#if taglines.length > 0}
<div class="flex flex-row justify-between items-center"> <div class="flex flex-row justify-between items-center">
<h1 class="font-bold text-2xl">Taglines</h1> <Header>{$t('routes.admin.taglines.title')}</Header>
<Button <Button
color="primary" color="primary"
on:click={save} on:click={save}
@@ -52,7 +54,7 @@
size="lg" size="lg"
class="h-max" class="h-max"
> >
Save {$t('common.save')}
</Button> </Button>
</div> </div>
<EditableList <EditableList
@@ -89,23 +91,19 @@
newTagline = '' newTagline = ''
}} }}
> >
<MarkdownEditor <MarkdownEditor bind:value={newTagline} images={false} />
bind:value={newTagline}
placeholder="Add a tagline"
images={false}
/>
<Button size="lg" submit> <Button size="lg" submit>
<Icon src={Plus} size="16" mini slot="prefix" /> <Icon src={Plus} size="16" mini slot="prefix" />
Add {$t('common.add')}
</Button> </Button>
</form> </form>
{:else} {:else}
<div class="my-auto"> <div class="my-auto">
<Placeholder <Placeholder
icon={Plus} icon={Plus}
title="No taglines" title={$t('routes.admin.taglines.empty.title')}
description="A random tagline will appear when users visit your instance." description={$t('routes.admin.taglines.empty.description')}
> >
<div class="mt-4 max-w-xl w-full flex flex-col gap-2"> <div class="mt-4 max-w-xl w-full flex flex-col gap-2">
<form <form
@@ -120,18 +118,18 @@
> >
<MarkdownEditor <MarkdownEditor
bind:value={newTagline} bind:value={newTagline}
placeholder="Add a tagline" placeholder={$t('routes.admin.taglines.add')}
images={false} images={false}
/> />
<Button size="lg" submit> <Button size="lg" submit>
<Icon src={Plus} size="16" mini slot="prefix" /> <Icon src={Plus} size="16" mini slot="prefix" />
Add {$t('common.add')}
</Button> </Button>
</form> </form>
<Button on:click={save} color="primary" size="lg" class="w-full"> <Button on:click={save} color="primary" size="lg" class="w-full">
Save {$t('common.save')}
</Button> </Button>
</div> </div>
</Placeholder> </Placeholder>
+6 -8
View File
@@ -10,6 +10,8 @@
import { removeItem, trycatch } from '$lib/util.js' import { removeItem, trycatch } from '$lib/util.js'
import { Button, TextInput } from 'mono-svelte' import { Button, TextInput } from 'mono-svelte'
import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons' import { Icon, Plus, QuestionMarkCircle, Trash } from 'svelte-hero-icons'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { t } from '$lib/translations.js'
export let data export let data
@@ -42,18 +44,14 @@
} }
</script> </script>
<svelte:head> <Header>{$t('routes.admin.team.title')}</Header>
<title>Admin Team</title>
</svelte:head>
<h1 class="font-bold text-2xl">Admins</h1>
{#if data.site} {#if data.site}
<EditableList let:action on:action={(e) => removeAdmin(e.detail, false)}> <EditableList let:action on:action={(e) => removeAdmin(e.detail, false)}>
{#if data.site.admins.length <= 0} {#if data.site.admins.length <= 0}
<Placeholder <Placeholder
icon={QuestionMarkCircle} icon={QuestionMarkCircle}
title="No admins" title={$t('routes.admin.team.empty.title')}
description="Somehow there's no admins of this site. How?!" description={$t('routes.admin.team.empty.description')}
/> />
{:else} {:else}
{#each data.site?.admins ?? [] as admin} {#each data.site?.admins ?? [] as admin}
@@ -96,7 +94,7 @@
/> />
<Button loading={adding} disabled={adding} size="md" class="h-full" submit> <Button loading={adding} disabled={adding} size="md" class="h-full" submit>
<Icon src={Plus} mini size="16" slot="prefix" /> <Icon src={Plus} mini size="16" slot="prefix" />
Add Admin {$t('common.add')}
</Button> </Button>
</form> </form>
{/if} {/if}