mirror of
https://github.com/cupcakearmy/svelte-i18n.git
synced 2024-06-30 18:54:49 +02:00
refactor: 💡 rename intl component
This commit is contained in:
parent
d6b8664009
commit
649b779a6e
15
Intl.svelte
Normal file
15
Intl.svelte
Normal 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} />
|
11
Lang.svelte
11
Lang.svelte
|
@ -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} />
|
|
Loading…
Reference in New Issue
Block a user