add language toggle

This commit is contained in:
2025-12-26 17:29:41 +01:00
parent ad3c3f2c6d
commit 01a31ae60a
12 changed files with 423 additions and 172 deletions

View File

@@ -0,0 +1,18 @@
import { setContext, getContext } from 'svelte';
import { writable } from 'svelte/store';
const LANGUAGE_CONTEXT_KEY = Symbol('language');
export function createLanguageContext() {
const showLatin = writable(true); // true = bilingual, false = monolingual
setContext(LANGUAGE_CONTEXT_KEY, {
showLatin
});
return { showLatin };
}
export function getLanguageContext() {
return getContext(LANGUAGE_CONTEXT_KEY);
}