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 type { PageData } from './$types.js';
|
||||
import AppCard from '$lib/components/app/AppCard.svelte';
|
||||
import AppForm from '$lib/components/app/AppForm.svelte';
|
||||
@@ -9,16 +10,16 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Apps — Web App Launcher</title>
|
||||
<title>{$t('app.title')} — {$t('app_title')}</title>
|
||||
</svelte:head>
|
||||
|
||||
<div class="p-6">
|
||||
<div class="mx-auto max-w-6xl">
|
||||
<div class="mb-6 flex items-center justify-between">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-foreground">App Registry</h1>
|
||||
<h1 class="text-2xl font-bold text-foreground">{$t('app.title')}</h1>
|
||||
<p class="mt-1 text-sm text-muted-foreground">
|
||||
{data.apps.length} app{data.apps.length === 1 ? '' : 's'} registered
|
||||
{$t('app.apps_registered', { values: { count: data.apps.length } })}
|
||||
</p>
|
||||
</div>
|
||||
<button
|
||||
@@ -26,13 +27,13 @@
|
||||
onclick={() => (showForm = !showForm)}
|
||||
class="rounded-lg bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring"
|
||||
>
|
||||
{showForm ? 'Cancel' : 'Add App'}
|
||||
{showForm ? $t('common.cancel') : $t('app.add')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if showForm}
|
||||
<div class="mb-6 rounded-xl border border-border bg-card p-6 shadow-sm">
|
||||
<h2 class="mb-4 text-lg font-semibold text-card-foreground">New App</h2>
|
||||
<h2 class="mb-4 text-lg font-semibold text-card-foreground">{$t('app.new')}</h2>
|
||||
<AppForm form={data.form} action="?/create" />
|
||||
</div>
|
||||
{/if}
|
||||
@@ -43,7 +44,7 @@
|
||||
href="/apps"
|
||||
class="rounded-full border border-border px-3 py-1 text-sm text-muted-foreground transition-colors hover:bg-accent hover:text-foreground"
|
||||
>
|
||||
All
|
||||
{$t('app.all_categories')}
|
||||
</a>
|
||||
{#each data.categories as category (category)}
|
||||
<a
|
||||
@@ -72,8 +73,8 @@
|
||||
<line x1="12" y1="8" x2="12" y2="12" />
|
||||
<line x1="12" y1="16" x2="12.01" y2="16" />
|
||||
</svg>
|
||||
<p class="text-lg">No apps registered yet.</p>
|
||||
<p class="mt-1 text-sm">Click "Add App" to register your first application.</p>
|
||||
<p class="text-lg">{$t('app.no_apps')}</p>
|
||||
<p class="mt-1 text-sm">{$t('app.no_apps_hint')}</p>
|
||||
</div>
|
||||
{:else}
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
|
||||
|
||||
Reference in New Issue
Block a user