feat(phase2): localization EN/RU + additional widget types
- Add svelte-i18n with 224 translation keys (English + Russian) - Language switcher in header (EN/RU toggle, persists to localStorage) - Extract all hardcoded strings from 37 component/page files - Add 4 new widget types: Bookmark, Note (markdown), Embed (iframe), Status - WidgetRenderer dispatches by type, WidgetGrid supports full-width widgets - Type-specific config forms in board editor - Install marked for markdown rendering
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { t } from 'svelte-i18n';
|
||||
import { superForm } from 'sveltekit-superforms';
|
||||
import type { PageData } from './$types.js';
|
||||
import AmbientBackground from '$lib/components/background/AmbientBackground.svelte';
|
||||
@@ -9,7 +10,7 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Register — Web App Launcher</title>
|
||||
<title>{$t('auth.register')} — {$t('app_title')}</title>
|
||||
</svelte:head>
|
||||
|
||||
<AmbientBackground />
|
||||
@@ -34,14 +35,14 @@
|
||||
<line x1="22" y1="11" x2="16" y2="11" />
|
||||
</svg>
|
||||
</div>
|
||||
<h1 class="text-2xl font-bold text-card-foreground">Create Account</h1>
|
||||
<p class="mt-1 text-sm text-muted-foreground">Get started with App Launcher</p>
|
||||
<h1 class="text-2xl font-bold text-card-foreground">{$t('auth.register_title')}</h1>
|
||||
<p class="mt-1 text-sm text-muted-foreground">{$t('auth.register_subtitle')}</p>
|
||||
</div>
|
||||
|
||||
<form method="POST" use:enhance class="space-y-4">
|
||||
<div>
|
||||
<label for="displayName" class="mb-1 block text-sm font-medium text-card-foreground">
|
||||
Display Name
|
||||
{$t('auth.display_name')}
|
||||
</label>
|
||||
<input
|
||||
id="displayName"
|
||||
@@ -50,7 +51,7 @@
|
||||
autocomplete="name"
|
||||
bind:value={$form.displayName}
|
||||
class="w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground transition-colors focus:border-primary focus:outline-none focus:ring-2 focus:ring-ring/30"
|
||||
placeholder="Your name"
|
||||
placeholder={$t('auth.display_name_placeholder')}
|
||||
/>
|
||||
{#if $errors.displayName}
|
||||
<p class="mt-1 text-sm text-destructive">{$errors.displayName[0]}</p>
|
||||
@@ -59,7 +60,7 @@
|
||||
|
||||
<div>
|
||||
<label for="email" class="mb-1 block text-sm font-medium text-card-foreground">
|
||||
Email
|
||||
{$t('auth.email')}
|
||||
</label>
|
||||
<input
|
||||
id="email"
|
||||
@@ -68,7 +69,7 @@
|
||||
autocomplete="email"
|
||||
bind:value={$form.email}
|
||||
class="w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground transition-colors focus:border-primary focus:outline-none focus:ring-2 focus:ring-ring/30"
|
||||
placeholder="you@example.com"
|
||||
placeholder={$t('auth.email_placeholder')}
|
||||
/>
|
||||
{#if $errors.email}
|
||||
<p class="mt-1 text-sm text-destructive">{$errors.email[0]}</p>
|
||||
@@ -77,7 +78,7 @@
|
||||
|
||||
<div>
|
||||
<label for="password" class="mb-1 block text-sm font-medium text-card-foreground">
|
||||
Password
|
||||
{$t('auth.password')}
|
||||
</label>
|
||||
<input
|
||||
id="password"
|
||||
@@ -86,7 +87,7 @@
|
||||
autocomplete="new-password"
|
||||
bind:value={$form.password}
|
||||
class="w-full rounded-lg border border-input bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-muted-foreground transition-colors focus:border-primary focus:outline-none focus:ring-2 focus:ring-ring/30"
|
||||
placeholder="At least 6 characters"
|
||||
placeholder={$t('auth.password_placeholder_register')}
|
||||
/>
|
||||
{#if $errors.password}
|
||||
<p class="mt-1 text-sm text-destructive">{$errors.password[0]}</p>
|
||||
@@ -101,17 +102,17 @@
|
||||
{#if $submitting}
|
||||
<span class="flex items-center justify-center gap-2">
|
||||
<span class="h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground border-t-transparent"></span>
|
||||
Creating account...
|
||||
{$t('auth.register_submitting')}
|
||||
</span>
|
||||
{:else}
|
||||
Create Account
|
||||
{$t('auth.register_submit')}
|
||||
{/if}
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<p class="mt-6 text-center text-sm text-muted-foreground">
|
||||
Already have an account?
|
||||
<a href="/login" class="font-medium text-primary hover:underline">Sign in</a>
|
||||
{$t('auth.have_account')}
|
||||
<a href="/login" class="font-medium text-primary hover:underline">{$t('auth.sign_in_link')}</a>
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user