mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 10:02:59 +08:00
fix(monorepo/server): get translations to work
This commit is contained in:
parent
c79e3f535a
commit
28ce71a203
@ -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")
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user