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
await i18next.use(Backend).init({
debug: true,
lng: getCurrentLanguage(),
fallbackLng: "en",
ns: "server",
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.
* 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.
*/
export function getResourceDir() {
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