svelte-i18n/Intl.svelte

16 lines
361 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, isLoading } from './dist/i18n.mjs'
2019-11-21 02:23:29 +01:00
$: updateLangAttr($locale)
</script>
<slot isLoading={$isLoading} locale={$locale} locales={$locales} />