🌐 feat(i18n): make all auth pages multilingual

Add dynamic locale support to all login, register, and forgot-password
pages across apps. Pages now use $locale from svelte-i18n instead of
hardcoded language codes.

Apps updated:
- clock: login (also consolidated to standard pattern)
- manacore: register
- manadeck: register
- nutriphi: login, register, forgot-password
- picture: register, forgot-password
- planta: login
- questions: login, register, forgot-password
- skilltree: login, register, forgot-password

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Till-JS 2026-02-01 12:54:52 +01:00
parent fdaf6a9c75
commit ff22a29723
15 changed files with 99 additions and 44 deletions

View file

@ -2,11 +2,13 @@
import { goto } from '$app/navigation';
import { ForgotPasswordPage } from '@manacore/shared-auth-ui';
import { getForgotPasswordTranslations } from '@manacore/shared-i18n';
import { locale } from 'svelte-i18n';
import { SkillTreeLogo } from '@manacore/shared-branding';
import { authStore } from '$lib/stores/auth.svelte';
import '$lib/i18n';
// Get translations (default to German for this app)
const translations = $derived(getForgotPasswordTranslations('de'));
// Get translations based on current locale
const translations = $derived(getForgotPasswordTranslations($locale || 'de'));
async function handleForgotPassword(email: string) {
return authStore.resetPassword(email);

View file

@ -4,9 +4,11 @@
import { browser } from '$app/environment';
import { LoginPage } from '@manacore/shared-auth-ui';
import { getLoginTranslations } from '@manacore/shared-i18n';
import { locale } from 'svelte-i18n';
import { SkillTreeLogo } from '@manacore/shared-branding';
import { authStore } from '$lib/stores/auth.svelte';
import { apiClient } from '$lib/api/client';
import '$lib/i18n';
// Get redirect URL from query params or sessionStorage
const redirectTo = $derived.by(() => {
@ -24,8 +26,8 @@
return '/';
});
// Get translations (default to German for this app)
const translations = $derived(getLoginTranslations('de'));
// Get translations based on current locale
const translations = $derived(getLoginTranslations($locale || 'de'));
// Read verification status from query params
const verified = $derived($page.url.searchParams.get('verified') === 'true');

View file

@ -3,8 +3,10 @@
import { browser } from '$app/environment';
import { RegisterPage } from '@manacore/shared-auth-ui';
import { getRegisterTranslations } from '@manacore/shared-i18n';
import { locale } from 'svelte-i18n';
import { SkillTreeLogo } from '@manacore/shared-branding';
import { authStore } from '$lib/stores/auth.svelte';
import '$lib/i18n';
// Get redirect URL from sessionStorage
const redirectTo = $derived.by(() => {
@ -18,8 +20,8 @@
return '/';
});
// Get translations (default to German for this app)
const translations = $derived(getRegisterTranslations('de'));
// Get translations based on current locale
const translations = $derived(getRegisterTranslations($locale || 'de'));
async function handleSignUp(email: string, password: string) {
return authStore.signUp(email, password);