477c0e4d52
- 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
20 lines
645 B
Svelte
20 lines
645 B
Svelte
<script lang="ts">
|
|
import { locale } from 'svelte-i18n';
|
|
import { storeLocale } from '$lib/i18n/index.js';
|
|
|
|
function toggleLocale() {
|
|
const next = $locale === 'ru' ? 'en' : 'ru';
|
|
locale.set(next);
|
|
storeLocale(next);
|
|
}
|
|
</script>
|
|
|
|
<button
|
|
type="button"
|
|
onclick={toggleLocale}
|
|
class="inline-flex items-center justify-center rounded-md px-2 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring"
|
|
title={$locale === 'ru' ? 'Switch to English' : 'Переключить на русский'}
|
|
>
|
|
{$locale === 'ru' ? 'RU' : 'EN'}
|
|
</button>
|