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 GroupTable from '$lib/components/admin/GroupTable.svelte';
|
||||
import { superForm } from 'sveltekit-superforms/client';
|
||||
@@ -18,28 +19,28 @@
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>Group Management — Admin</title>
|
||||
<title>{$t('admin.group_management')} — {$t('admin.panel')}</title>
|
||||
</svelte:head>
|
||||
|
||||
<div>
|
||||
<div class="mb-6 flex items-center justify-between">
|
||||
<h1 class="text-2xl font-bold text-card-foreground">Group Management</h1>
|
||||
<h1 class="text-2xl font-bold text-card-foreground">{$t('admin.group_management')}</h1>
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => (showCreateForm = !showCreateForm)}
|
||||
class="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90 focus:outline-none focus:ring-2 focus:ring-ring"
|
||||
>
|
||||
{showCreateForm ? 'Cancel' : 'Create Group'}
|
||||
{showCreateForm ? $t('common.cancel') : $t('admin.create_group')}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{#if showCreateForm}
|
||||
<div class="mb-6 rounded-lg border border-border bg-card p-6">
|
||||
<h2 class="mb-4 text-lg font-semibold text-card-foreground">New Group</h2>
|
||||
<h2 class="mb-4 text-lg font-semibold text-card-foreground">{$t('admin.new_group')}</h2>
|
||||
<form method="POST" action="?/create" use:enhance class="space-y-4">
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||
<div>
|
||||
<label for="name" class="mb-1 block text-sm font-medium text-foreground">Name</label>
|
||||
<label for="name" class="mb-1 block text-sm font-medium text-foreground">{$t('common.name')}</label>
|
||||
<input
|
||||
id="name"
|
||||
name="name"
|
||||
@@ -51,7 +52,7 @@
|
||||
{#if $errors.name}<span class="text-xs text-destructive">{$errors.name}</span>{/if}
|
||||
</div>
|
||||
<div>
|
||||
<label for="description" class="mb-1 block text-sm font-medium text-foreground">Description</label>
|
||||
<label for="description" class="mb-1 block text-sm font-medium text-foreground">{$t('common.description')}</label>
|
||||
<input
|
||||
id="description"
|
||||
name="description"
|
||||
@@ -68,7 +69,7 @@
|
||||
bind:checked={$form.isDefault}
|
||||
class="h-4 w-4 rounded border-input"
|
||||
/>
|
||||
<label for="isDefault" class="text-sm font-medium text-foreground">Default group (auto-assign new users)</label>
|
||||
<label for="isDefault" class="text-sm font-medium text-foreground">{$t('admin.default_group_hint')}</label>
|
||||
</div>
|
||||
</div>
|
||||
{#if $errors._errors}
|
||||
@@ -78,7 +79,7 @@
|
||||
type="submit"
|
||||
class="rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground hover:bg-primary/90"
|
||||
>
|
||||
Create Group
|
||||
{$t('admin.create_group')}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user