svelte-i18n/Intl.svelte
2019-11-22 13:51:18 -03:00

16 lines
355 B
Svelte

<script context="module">
function updateLangAttr(lang) {
if (typeof window !== 'undefined') {
document.documentElement.setAttribute('lang', lang)
}
}
</script>
<script>
import { locale, locales, loading } from './dist/i18n.mjs'
$: updateLangAttr($locale)
</script>
<slot loading={$loading} locale={$locale} locales={$locales} />