i18n: localize account pages

This commit is contained in:
Xylight committed 2024-06-04 10:51:25 -07:00
1 parent 53d4e4bfa3
commit 9998042795
5 files changed
+35 -33

No files matched your search

+13 -1
View File
@@ -171,7 +171,10 @@
},
"modlog": "Modlog",
"instances": "Instances",
"legal": "Legal",
"legal": {
"title": "Legal",
"noLegal": "This instance does not have any legal information."
},
"profile": {
"user": "User",
"settings": "Settings",
@@ -229,6 +232,15 @@
"verifyEmail": {
"message": "Your email was verified. You can now close this window.",
"error": "Failed to verify your email."
},
"passwordChange": {
"title": "Change Password",
"description": "Choose your new password.",
"instance": "Which instance is your account hosted on?"
},
"resetLogin": {
"title": "Reset Password",
"description": "Enter your account's email, and a password reset link will be sent. If your account does not have an email, contact your instance admins."
}
},
"cards": {
+4 -14
View File
@@ -1,7 +1,9 @@
<script lang="ts">
import SiteCard from '$lib/components/lemmy/SiteCard.svelte'
import Markdown from '$lib/components/markdown/Markdown.svelte'
import Header from '$lib/components/ui/layout/pages/Header.svelte'
import { site } from '$lib/lemmy'
import { t } from '$lib/translations'
import { Button, Modal, Spinner } from 'mono-svelte'
let siteOpen: boolean = false
@@ -9,23 +11,11 @@
<div class="flex flex-row w-full">
{#if $site}
<Modal bind:open={siteOpen}>
<SiteCard
site={$site.site_view}
admins={$site.admins}
taglines={$site.taglines}
/>
</Modal>
<div class="flex flex-col flex-1 gap-4">
<h1 class="font-bold text-2xl w-full flex items-center justify-between">
Legal <span class="lg:hidden">
<Button on:click={() => (siteOpen = !siteOpen)}>Site</Button>
</span>
</h1>
<Header>{$t('routes.legal.title')}</Header>
<Markdown
source={$site.site_view.local_site.legal_information ??
'This instance does not have any legal information.'}
$t('routes.legal.noLegal')}
/>
</div>
{:else}
+6 -6
View File
@@ -5,6 +5,7 @@
instance as currentInstance,
} from '$lib/instance.js'
import { getClient, validateInstance } from '$lib/lemmy.js'
import { t } from '$lib/translations'
import { Button, TextInput, toast } from 'mono-svelte'
let instance = LINKED_INSTANCE_URL || $currentInstance || ''
@@ -36,29 +37,28 @@
</script>
<div class="my-auto max-w-xl mx-auto flex flex-col gap-2">
<h1 class="font-bold text-3xl">Reset Password</h1>
<h1 class="font-bold text-3xl">{$t('routes.resetLogin.title')}</h1>
<p>
Enter the email of your account, and a password reset link will be sent. If
you did not have an email set up, contact your instance admins.
{$t('routes.resetLogin.description')}
</p>
<form class="mt-2 flex flex-col gap-4" on:submit|preventDefault={submit}>
{#if !LINKED_INSTANCE_URL}
<TextInput
bind:value={instance}
label="Instance URL"
label={$t('form.instance')}
placeholder={DEFAULT_INSTANCE_URL}
required
/>
{/if}
<TextInput
bind:value={email}
label="Email"
label={$t('form.email')}
type="email"
required
placeholder="example@example.com"
/>
<Button color="primary" size="lg" {loading} disabled={loading} submit>
Submit
{$t('form.submit')}
</Button>
</form>
</div>
@@ -1,5 +1,6 @@
<script>
import { page } from '$app/stores'
import { t } from '$lib/translations'
import { XMark, Icon } from 'svelte-hero-icons'
</script>
@@ -9,9 +10,8 @@
>
<Icon src={XMark} size="32" mini />
</div>
<h1 class="text-red-800 dark:text-red-300 text-2xl font-semibold">Error</h1>
<p class="text-red-800 dark:text-red-300">
That password reset token doesn't exist.
</p>
<h1 class="text-red-800 dark:text-red-300 text-2xl font-semibold">
{$t('message.error')}
</h1>
<code>{$page.error?.message}</code>
</div>
@@ -6,6 +6,7 @@
instance as currentInstance,
} from '$lib/instance.js'
import { getClient, validateInstance } from '$lib/lemmy.js'
import { t } from '$lib/translations'
import { Button, TextInput, toast } from 'mono-svelte'
export let data: {
@@ -46,38 +47,37 @@
</script>
<div class="my-auto max-w-xl mx-auto flex flex-col gap-2">
<h1 class="font-bold text-3xl">Reset Password</h1>
<h1 class="font-bold text-3xl">{$t('routes.passwordChange.title')}</h1>
<p>
You've clicked an email with the password reset link in it. Now, choose your
new password.
{$t('routes.passwordChange.description')}
</p>
<form class="mt-2 flex flex-col gap-4" on:submit|preventDefault={submit}>
{#if !LINKED_INSTANCE_URL}
<TextInput
bind:value={instance}
label="Instance URL"
label={$t('form.password')}
placeholder={DEFAULT_INSTANCE_URL}
required
>
<span class="font-normal text-xs">
What instance did you reset your password for?
{$t('routes.passwordChange.instance')}
</span>
</TextInput>
{/if}
<TextInput
bind:value={password}
label="New Password"
label={$t('form.profile.newPassword')}
type="password"
required
/>
<TextInput
bind:value={password_verify}
label="New Password (Verify)"
label={$t('form.profile.verifyNewPassword')}
type="password"
required
/>
<Button color="primary" size="lg" {loading} disabled={loading} submit>
Submit
{$t('form.submit')}
</Button>
</form>
</div>