i18n: localize posts

This commit is contained in:
Xylight committed 2024-06-03 15:49:03 -07:00
1 parent 64107e51a0
commit c4236fa124
9 files changed
+110 -31

No files matched your search

@@ -1,11 +1,15 @@
<script lang="ts">
import { locale } from '$lib/translations'
export let number: number
export let locale: string = 'en'
let localeToUse: string = $locale
export let options: Intl.NumberFormatOptions = {
notation: 'compact',
}
export { localeToUse as locale }
</script>
<span class={$$props.class ?? ''}>
{Intl.NumberFormat(locale, options).format(number)}
{Intl.NumberFormat(localeToUse, options).format(number)}
</span>