From eb8013ccb04ff1071f1a5f2b71fc9dd63633e32d Mon Sep 17 00:00:00 2001 From: Mawoka Date: Sun, 12 Jun 2022 12:08:01 +0200 Subject: [PATCH] :rotating_light: Handled issue where variable was used before initialisation --- frontend/src/lib/i18n/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/lib/i18n/index.ts b/frontend/src/lib/i18n/index.ts index 7b5496c..a71823c 100644 --- a/frontend/src/lib/i18n/index.ts +++ b/frontend/src/lib/i18n/index.ts @@ -4,6 +4,11 @@ import type { TType } from './translation-service'; import type { Readable, Writable } from 'svelte/store'; import { getContext, setContext } from 'svelte'; +export type I18nContext = { + t: Readable; + currentLanguage: Writable; +}; + export const setLocalization = (context: I18nContext) => { return setContext(CONTEXT_KEY, context); }; @@ -29,8 +34,3 @@ export const initLocalizationContext = () => { }; }; const CONTEXT_KEY = 't'; - -export type I18nContext = { - t: Readable; - currentLanguage: Writable; -};