Files
web-app-launcher/src/routes/+layout.svelte
T
alexei.dolgolyov 477c0e4d52 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
2026-03-24 23:18:05 +03:00

45 lines
1.3 KiB
Svelte

<script lang="ts">
import '../app.css';
import '$lib/i18n/index.js';
import type { Snippet } from 'svelte';
import type { LayoutData } from './$types.js';
import MainLayout from '$lib/components/layout/MainLayout.svelte';
import { page } from '$app/stores';
import { fade } from 'svelte/transition';
import { theme } from '$lib/stores/theme.svelte';
import { ui } from '$lib/stores/ui.svelte';
import { search } from '$lib/stores/search.svelte';
let { data, children }: { data: LayoutData; children: Snippet } = $props();
// Initialize store effects within component context
theme.initEffects();
ui.initEffects();
search.initEffects();
// Pages that should NOT have the main layout (login, register)
const noLayoutPaths = ['/login', '/register'];
const showLayout = $derived(!noLayoutPaths.includes($page.url.pathname));
const pageKey = $derived($page.url.pathname);
</script>
{#if showLayout}
<MainLayout
user={data.user ?? null}
boards={data.sidebarBoards ?? []}
>
{#key pageKey}
<div in:fade={{ duration: 150, delay: 75 }} out:fade={{ duration: 75 }}>
{@render children()}
</div>
{/key}
</MainLayout>
{:else}
{#key pageKey}
<div in:fade={{ duration: 150, delay: 75 }} out:fade={{ duration: 75 }}>
{@render children()}
</div>
{/key}
{/if}