diff --git a/src/mixins.ts b/src/mixins.ts index ec0f00b..310f18d 100644 --- a/src/mixins.ts +++ b/src/mixins.ts @@ -6,8 +6,10 @@ export function truncate(value: string, length: number) { } } +let language = localStorage.getItem("language") || "en-us" + export function abbreviate(text: number) { - return Intl.NumberFormat('en-US', { + return Intl.NumberFormat(language, { //@ts-ignore notation: 'compact', maximumFractionDigits: 1 @@ -20,10 +22,6 @@ const rootBackendUrl = `${protocol}${import.meta.env.SAFETWITCH_BACKEND_DOMAIN}/ export async function getEndpoint(endpoint: string) { let data - let language = localStorage.getItem("language") - if (language === null) { - language = "en-US" - } try { const res = await fetch(rootBackendUrl + endpoint, {