anki/ts/sveltelib/WithBase.svelte

14 lines
346 B
Svelte
Raw Normal View History

2021-03-25 21:11:40 +01:00
<script lang="typescript">
import useAsync from "sveltelib/async";
import { setupI18n } from "anki/i18n";
import { checkNightMode } from "anki/nightmode";
const nightMode = checkNightMode();
const { loading, value: i18n } = useAsync(() => setupI18n());
</script>
{#if !$loading}
<slot i18n={$i18n} {nightMode} />
{/if}