mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-11-16 18:10:43 +01:00
16 lines
361 B
Svelte
16 lines
361 B
Svelte
<script context="module">
|
|
function updateLangAttr(lang) {
|
|
if (typeof window !== 'undefined') {
|
|
document.documentElement.setAttribute('lang', lang)
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<script>
|
|
import { locale, locales, isLoading } from './dist/i18n.mjs'
|
|
|
|
$: updateLangAttr($locale)
|
|
</script>
|
|
|
|
<slot isLoading={$isLoading} locale={$locale} locales={$locales} />
|