fix(monorepo/server): get translations to work

This commit is contained in:
Elian Doran 2025-04-24 11:38:50 +03:00
parent c79e3f535a
commit 28ce71a203
No known key found for this signature in database
10 changed files with 4 additions and 3 deletions

View File

@ -80,11 +80,12 @@ export async function initializeTranslations() {
// Initialize translations // Initialize translations
await i18next.use(Backend).init({ await i18next.use(Backend).init({
debug: true,
lng: getCurrentLanguage(), lng: getCurrentLanguage(),
fallbackLng: "en", fallbackLng: "en",
ns: "server", ns: "server",
backend: { backend: {
loadPath: join(resourceDir, "translations/{{lng}}/{{ns}}.json") loadPath: join(resourceDir, "assets/translations/{{lng}}/{{ns}}.json")
} }
}); });
} }

View File

@ -285,13 +285,13 @@ export function envToBoolean(val: string | undefined) {
/** /**
* Returns the directory for resources. On Electron builds this corresponds to the `resources` subdirectory inside the distributable package. * Returns the directory for resources. On Electron builds this corresponds to the `resources` subdirectory inside the distributable package.
* On development builds, this simply refers to the root directory of the application. * On development builds, this simply refers to the src directory of the application.
* *
* @returns the resource dir. * @returns the resource dir.
*/ */
export function getResourceDir() { export function getResourceDir() {
if (isElectron && !isDev) return process.resourcesPath; if (isElectron && !isDev) return process.resourcesPath;
return join(dirname(fileURLToPath(import.meta.url)), "..", ".."); return join(dirname(fileURLToPath(import.meta.url)), "..");
} }
// TODO: Deduplicate with src/public/app/services/utils.ts // TODO: Deduplicate with src/public/app/services/utils.ts