Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

feat: implement i18n configuration with support for English and Portuguese locales

Tonhoca6634bf2b66
diff --git a/src/lib/i18n/index.ts b/src/lib/i18n/index.ts
new file mode 100644
index 00000000..4e3ba6a2
--- /dev/null
+++ b/src/lib/i18n/index.ts
@@ -0,0 +1,22 @@
+import i18n from "sveltekit-i18n";
+
+type Payload = [payload?: Record<string, unknown>];
+
+const config = {
+ loaders: [
+ {
+ locale: "pt",
+ key: "",
+ loader: async () => (await import("./pt.json")).default,
+ },
+ {
+ locale: "en",
+ key: "",
+ loader: async () => (await import("./en.json")).default,
+ },
+ ],
+};
+
+export const defaultLocale = "pt";
+
+export const { t, locale, locales, loading, loadTranslations } = new i18n<Payload>(config);