From a4a857062b9ea8014e20767566bce15b516db5b6 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Sun, 25 Oct 2026 02:23:22 +0200 Subject: [PATCH] chore(i18n): migrate i18n to TypeScript Updated i18n module to .ts and added type annotations. --- src/{i18n.js => i18n.ts} | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) rename src/{i18n.js => i18n.ts} (86%) diff --git a/src/i18n.js b/src/i18n.ts similarity index 86% rename from src/i18n.js rename to src/i18n.ts index 0a766df..db72b27 100644 --- a/src/i18n.js +++ b/src/i18n.ts @@ -28,9 +28,11 @@ export const i18n = createI18n({ messages: {}, }); -const loadedLanguages = new Set(); +const loadedLanguages = new Set(); -export const loadLanguage = async function loadLanguage(locale) { +export const loadLanguage = async function loadLanguage( + locale: string, +): Promise { if (!SUPPORTED_LANGUAGES.includes(locale)) { locale = fallbackLocale; } @@ -48,7 +50,9 @@ export const loadLanguage = async function loadLanguage(locale) { loadedLanguages.add(locale); }; -export const setLocale = async function setLocale(locale) { +export const setLocale = async function setLocale( + locale: string, +): Promise { await loadLanguage(locale); document.documentElement.lang = locale; document.documentElement.dir = LANGUAGES_RTL.includes(locale)