refactor: 💡 rename intl component

This commit is contained in:
Christian Kaisermann 2019-11-20 22:23:29 -03:00
parent d6b8664009
commit 649b779a6e
2 changed files with 15 additions and 11 deletions

15
Intl.svelte Normal file
View File

@ -0,0 +1,15 @@
<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} />

View File

@ -1,11 +0,0 @@
<script>
import { locale, loading } from './dist/i18n.mjs'
$: {
if (typeof window !== 'undefined') {
document.documentElement.setAttribute('lang', $locale)
}
}
</script>
<slot loading={$loading} locale={$locale} />