From 999804279598f2b87d123289cb59b035516f0011 Mon Sep 17 00:00:00 2001 From: Xylight Date: Tue, 4 Jun 2024 10:51:25 -0700 Subject: [PATCH] i18n: localize account pages --- src/lib/i18n/en.json | 14 +++++++++++++- src/routes/legal/+page.svelte | 18 ++++-------------- src/routes/login_reset/+page.svelte | 12 ++++++------ .../password_change/[token]/+error.svelte | 8 ++++---- .../password_change/[token]/+page.svelte | 16 ++++++++-------- 5 files changed, 35 insertions(+), 33 deletions(-) diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index fd583eaf..3c03568f 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -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": { diff --git a/src/routes/legal/+page.svelte b/src/routes/legal/+page.svelte index 0e6ccf7b..c9e42156 100644 --- a/src/routes/legal/+page.svelte +++ b/src/routes/legal/+page.svelte @@ -1,7 +1,9 @@
-

Reset Password

+

{$t('routes.resetLogin.title')}

- 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')}

{#if !LINKED_INSTANCE_URL} {/if}
diff --git a/src/routes/password_change/[token]/+error.svelte b/src/routes/password_change/[token]/+error.svelte index ed12fc81..a980c10b 100644 --- a/src/routes/password_change/[token]/+error.svelte +++ b/src/routes/password_change/[token]/+error.svelte @@ -1,5 +1,6 @@ @@ -9,9 +10,8 @@ > -

Error

-

- That password reset token doesn't exist. -

+

+ {$t('message.error')} +

{$page.error?.message} diff --git a/src/routes/password_change/[token]/+page.svelte b/src/routes/password_change/[token]/+page.svelte index f1d1e835..2f1dedd0 100644 --- a/src/routes/password_change/[token]/+page.svelte +++ b/src/routes/password_change/[token]/+page.svelte @@ -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 @@
-

Reset Password

+

{$t('routes.passwordChange.title')}

- You've clicked an email with the password reset link in it. Now, choose your - new password. + {$t('routes.passwordChange.description')}

{#if !LINKED_INSTANCE_URL} - What instance did you reset your password for? + {$t('routes.passwordChange.instance')} {/if}