electron: Fix loading of i18n

This commit is contained in:
Elian Doran
2024-09-08 17:40:05 +03:00
parent d00c028a0c
commit 68042994e0
7 changed files with 26 additions and 20 deletions

15
src/services/i18n.ts Normal file
View File

@@ -0,0 +1,15 @@
import i18next from "i18next";
import Backend from "i18next-fs-backend";
export async function initializeTranslations() {
// Initialize translations
await i18next.use(Backend).init({
lng: "ro",
fallbackLng: "en",
ns: "server",
backend: {
loadPath: "translations/{{lng}}/{{ns}}.json"
},
debug: true
});
}