i18n: localize post badges
This commit is contained in:
1 parent
0f0e34d347
commit
f9935cee32
4 files changed
+44
-13
No files matched your search
@@ -1,4 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { locale } from '$lib/translations'
|
||||
|
||||
export let date: Date
|
||||
export let relativeTo: Date | undefined = undefined
|
||||
export let options: Intl.RelativeTimeFormatOptions = {
|
||||
@@ -36,7 +38,7 @@
|
||||
if (diffInMillis >= thresholds[i].threshold) {
|
||||
const value = Math.round(diffInMillis / thresholds[i].threshold)
|
||||
|
||||
let language = 'en'
|
||||
let language = $locale
|
||||
if (typeof navigator != 'undefined') {
|
||||
language = navigator.language
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user