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';
|
||||
@@ -12,7 +13,7 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Login — Web App Launcher</title>
|
||||
<title>{$t('auth.login_submit')} — {$t('app_title')}</title>
|
||||
</svelte:head>
|
||||
|
||||
<AmbientBackground />
|
||||
@@ -37,8 +38,8 @@
|
||||
<rect x="3" y="14" width="7" height="7" />
|
||||
</svg>
|
||||
</div>
|
||||
<h1 class="text-2xl font-bold text-card-foreground">Welcome back</h1>
|
||||
<p class="mt-1 text-sm text-muted-foreground">Sign in to your account</p>
|
||||
<h1 class="text-2xl font-bold text-card-foreground">{$t('auth.login_title')}</h1>
|
||||
<p class="mt-1 text-sm text-muted-foreground">{$t('auth.login_subtitle')}</p>
|
||||
</div>
|
||||
|
||||
{#if showOAuthButton}
|
||||
@@ -51,7 +52,7 @@
|
||||
<polyline points="10 17 15 12 10 7" />
|
||||
<line x1="15" y1="12" x2="3" y2="12" />
|
||||
</svg>
|
||||
Sign in with OAuth
|
||||
{$t('auth.oauth_signin')}
|
||||
</a>
|
||||
{/if}
|
||||
|
||||
@@ -61,7 +62,7 @@
|
||||
<div class="w-full border-t border-border"></div>
|
||||
</div>
|
||||
<div class="relative flex justify-center text-xs uppercase">
|
||||
<span class="bg-card px-2 text-muted-foreground">or</span>
|
||||
<span class="bg-card px-2 text-muted-foreground">{$t('auth.or')}</span>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -70,7 +71,7 @@
|
||||
<form method="POST" use:enhance class="space-y-4">
|
||||
<div>
|
||||
<label for="email" class="mb-1 block text-sm font-medium text-card-foreground">
|
||||
Email
|
||||
{$t('auth.email')}
|
||||
</label>
|
||||
<input
|
||||
id="email"
|
||||
@@ -79,7 +80,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>
|
||||
@@ -88,7 +89,7 @@
|
||||
|
||||
<div>
|
||||
<label for="password" class="mb-1 block text-sm font-medium text-card-foreground">
|
||||
Password
|
||||
{$t('auth.password')}
|
||||
</label>
|
||||
<input
|
||||
id="password"
|
||||
@@ -97,7 +98,7 @@
|
||||
autocomplete="current-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="Enter your password"
|
||||
placeholder={$t('auth.password_placeholder')}
|
||||
/>
|
||||
{#if $errors.password}
|
||||
<p class="mt-1 text-sm text-destructive">{$errors.password[0]}</p>
|
||||
@@ -112,10 +113,10 @@
|
||||
{#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>
|
||||
Signing in...
|
||||
{$t('auth.login_submitting')}
|
||||
</span>
|
||||
{:else}
|
||||
Sign In
|
||||
{$t('auth.login_submit')}
|
||||
{/if}
|
||||
</button>
|
||||
</form>
|
||||
@@ -123,8 +124,8 @@
|
||||
|
||||
{#if showLocalForm}
|
||||
<p class="mt-6 text-center text-sm text-muted-foreground">
|
||||
Don't have an account?
|
||||
<a href="/register" class="font-medium text-primary hover:underline">Register</a>
|
||||
{$t('auth.no_account')}
|
||||
<a href="/register" class="font-medium text-primary hover:underline">{$t('auth.register')}</a>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user