svelte-i18n/Lang.svelte

13 lines
224 B
Svelte
Raw Normal View History

2019-11-19 22:23:20 +01:00
<script>
import { locale } from './dist/i18n.mjs'
let loading = false
$: {
if (typeof window !== 'undefined') {
document.documentElement.setAttribute('lang', $locale)
}
}
</script>
<slot {loading} />