From a785a529c889b9e71231e41e1512ad70b31e5301 Mon Sep 17 00:00:00 2001 From: Xylight Date: Mon, 3 Jun 2024 18:04:14 -0700 Subject: [PATCH] i18n: localize signup --- src/lib/i18n/en.json | 19 ++++++++++++- src/lib/i18n/fr.json | 1 + src/routes/signup/+page.svelte | 14 +++++----- src/routes/signup/[instance]/+page.svelte | 33 +++++++++++++---------- 4 files changed, 45 insertions(+), 22 deletions(-) diff --git a/src/lib/i18n/en.json b/src/lib/i18n/en.json index eeabd03e..b7615178 100644 --- a/src/lib/i18n/en.json +++ b/src/lib/i18n/en.json @@ -103,6 +103,7 @@ "name": "Name", "instance": "Instance URL", "password": "Password", + "confirmPassword": "Confirm Password", "2fa": "2FA Code", "forgotpassword": "Forgot Password", "submit": "Submit", @@ -145,7 +146,23 @@ "warning": "This will delete ALL of your submissions." } }, - "setup": "Setup" + "email": "Email", + "setup": "Setup", + "signup": { + "title": "Sign Up", + "description": "Choose an instance that interests you, or type the URL manually.", + "info": "An instance is the server that your account will be hosted on, but you can still access and interact with content from other instances.", + "chooseInstance": "Choose an instance", + "application": { + "label": "Application", + "info": "To join this instance, you must fill out this application, and wait to be accepted. You will receive an email if your application is accepted." + }, + "closed": { + "title": "Registrations closed", + "description": "This instance has registrations closed. Find another instance.", + "anotherInstance": "Find another instance" + } + } }, "routes": { "frontpage": { diff --git a/src/lib/i18n/fr.json b/src/lib/i18n/fr.json index 11bf994e..8533ae0c 100644 --- a/src/lib/i18n/fr.json +++ b/src/lib/i18n/fr.json @@ -101,6 +101,7 @@ "submit": "Soumettre", "edit": "Modifier", "preview": "Aperçu", + "email": "Email", "post": { "create": "Créer une publication", "edit": "Modifier la publication", diff --git a/src/routes/signup/+page.svelte b/src/routes/signup/+page.svelte index 20655ef5..c5cff7cd 100644 --- a/src/routes/signup/+page.svelte +++ b/src/routes/signup/+page.svelte @@ -21,6 +21,7 @@ import { Button, TextInput } from 'mono-svelte' import { onMount } from 'svelte' import Avatar from '$lib/components/ui/Avatar.svelte' + import { t } from '$lib/translations' let selectedInstance: string = '' let validating: boolean = false @@ -78,15 +79,14 @@ - Sign up | Choose Instance + {$t('form.signup.title')}
-

Sign Up

-

Choose an instance that interests you, or type the URL manually.

+

{$t('form.signup.title')}

+

{$t('form.signup.description')}

- An instance is the server that your account will be hosted on, but you can - still access and interact with content from other instances. + {$t('form.signup.info')}

{ @@ -154,7 +154,7 @@ loading={validating} disabled={validating} > - Go + {$t('form.submit')}
diff --git a/src/routes/signup/[instance]/+page.svelte b/src/routes/signup/[instance]/+page.svelte index e36a3e99..38502dc8 100644 --- a/src/routes/signup/[instance]/+page.svelte +++ b/src/routes/signup/[instance]/+page.svelte @@ -20,6 +20,8 @@ XCircle, } from 'svelte-hero-icons' import { instance as currentInstance } from '$lib/instance.js' + import Header from '$lib/components/ui/layout/pages/Header.svelte' + import { t } from '$lib/translations.js' export let data @@ -125,36 +127,39 @@ {#if data.site_view.local_site.registration_mode != 'Closed'} -

Create account

+
{$t('form.signup.title')}
- + {#if data.site_view.local_site.registration_mode == 'RequireApplication'} - To join this instance, you must fill out this application, and wait to be - accepted. You will receive an email if your application is accepted. + {$t('form.signup.application.info')} {#if data.site_view.local_site.application_question} {/if} - + {/if} {#if captchaRequired}
@@ -194,7 +199,7 @@
{/if} - Show NSFW content + {$t('form.profile.showNSFW')} {:else}
-