diff --git a/frontend/src/lib/i18n/index.ts b/frontend/src/lib/i18n/index.ts index 79fc102..7b5496c 100644 --- a/frontend/src/lib/i18n/index.ts +++ b/frontend/src/lib/i18n/index.ts @@ -4,6 +4,15 @@ import type { TType } from './translation-service'; import type { Readable, Writable } from 'svelte/store'; import { getContext, setContext } from 'svelte'; +export const setLocalization = (context: I18nContext) => { + return setContext(CONTEXT_KEY, context); +}; + +// To make retrieving the t function easier. +export const getLocalization = () => { + return getContext(CONTEXT_KEY); +}; + export const initLocalizationContext = () => { // Initialize our services const i18n = new I18nService(); @@ -25,12 +34,3 @@ export type I18nContext = { t: Readable; currentLanguage: Writable; }; - -export const setLocalization = (context: I18nContext) => { - return setContext(CONTEXT_KEY, context); -}; - -// To make retrieving the t function easier. -export const getLocalization = () => { - return getContext(CONTEXT_KEY); -};