svelte-i18n/Intl.svelte

16 lines
355 B
Svelte
Raw Normal View History

2019-11-21 02:23:29 +01:00
<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} />