Skip to content
This repository was archived by the owner on Jun 24, 2025. It is now read-only.

Commit 4faf273

Browse files
committed
Merge branch 'develop' of ssh://github.com/TriliumNext/Notes into develop
2 parents 52a6d0b + cddc9a7 commit 4faf273

File tree

5 files changed

+29
-10
lines changed

5 files changed

+29
-10
lines changed

forge.config.cjs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ module.exports = {
1010
overwrite: true,
1111
asar: true,
1212
icon: "./images/app-icons/icon",
13-
extraResource: getExtraResourcesForPlatform(),
13+
extraResource: [
14+
// Moved to root
15+
...getExtraResourcesForPlatform(),
16+
17+
// Moved to resources (TriliumNext Notes.app/Contents/Resources on macOS)
18+
"translations/"
19+
],
1420
afterComplete: [(buildPath, _electronVersion, platform, _arch, callback) => {
1521
const extraResources = getExtraResourcesForPlatform();
1622
for (const resource of extraResources) {
@@ -77,8 +83,7 @@ module.exports = {
7783
function getExtraResourcesForPlatform() {
7884
let resources = [
7985
'dump-db/',
80-
'./bin/tpl/anonymize-database.sql',
81-
'translations/'
86+
'./bin/tpl/anonymize-database.sql'
8287
];
8388
const scripts = ['trilium-portable', 'trilium-safe-mode', 'trilium-no-cert-check']
8489
switch (process.platform) {

src/public/translations/en/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@
13271327
"mermaid-diagram": "Mermaid Diagram",
13281328
"canvas": "Canvas",
13291329
"web-view": "Web View",
1330-
"mind-map": "Mind Map",
1330+
"mind-map": "Mind Map (Beta)",
13311331
"file": "File",
13321332
"image": "Image",
13331333
"launcher": "Launcher",

src/public/translations/es/translation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,7 @@
13171317
"mermaid-diagram": "Diagrama Mermaid",
13181318
"canvas": "Lienzo",
13191319
"web-view": "Vista Web",
1320-
"mind-map": "Mapa Mental",
1320+
"mind-map": "Mapa Mental (beta)",
13211321
"file": "Archivo",
13221322
"image": "Imagen",
13231323
"launcher": "Lanzador",

src/public/translations/ro/translation.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@
12911291
"canvas": "Schiță",
12921292
"code": "Cod sursă",
12931293
"mermaid-diagram": "Diagramă Mermaid",
1294-
"mind-map": "Hartă mentală",
1294+
"mind-map": "Hartă mentală (beta)",
12951295
"note-map": "Hartă notițe",
12961296
"relation-map": "Hartă relații",
12971297
"render-note": "Randare notiță",
@@ -1374,7 +1374,7 @@
13741374
"window-on-top": "Menține fereastra mereu vizibilă"
13751375
},
13761376
"note_detail": {
1377-
"could_not_find_typewidget": "Nu s-a putut găsi typeWidget-ul pentru tipul „{{type}}”"
1377+
"could_not_find_typewidget": "Nu s-a putut găsi widget-ul corespunzător tipului „{{type}}”"
13781378
},
13791379
"note_title": {
13801380
"placeholder": "introduceți titlul notiței aici..."
@@ -1387,8 +1387,8 @@
13871387
"snapshot_number_limit_label": "Numărul maxim de revizii pentru notițe:"
13881388
},
13891389
"search_result": {
1390-
"no_notes_found": "Nu s-a găsit nicio notiță pentru parametrii de căutare dați.",
1391-
"search_not_executed": "Căutarea n-a fost încă executată. Clic pe butonul „Căutare” de deasupra pentru a vedea rezultatele."
1390+
"no_notes_found": "Nu au fost găsite notițe pentru parametrii de căutare dați.",
1391+
"search_not_executed": "Căutarea n-a fost rulată încă. Clic pe butonul „Căutare” de deasupra pentru a vedea rezultatele."
13921392
},
13931393
"show_floating_buttons_button": {
13941394
"button_title": "Afișează butoanele"

src/services/i18n.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,33 @@ import i18next from "i18next";
22
import Backend from "i18next-fs-backend";
33
import options from "./options.js";
44
import sql_init from "./sql_init.js";
5+
import { fileURLToPath } from "url";
6+
import { dirname, join } from "path";
7+
import utils from "./utils.js";
8+
import env from "./env.js";
59

610
export async function initializeTranslations() {
11+
const resourceDir = getResourceDir();
12+
713
// Initialize translations
814
await i18next.use(Backend).init({
915
lng: getCurrentLanguage(),
1016
fallbackLng: "en",
1117
ns: "server",
1218
backend: {
13-
loadPath: "translations/{{lng}}/{{ns}}.json"
19+
loadPath: join(resourceDir, "translations/{{lng}}/{{ns}}.json")
1420
}
1521
});
1622
}
1723

24+
function getResourceDir() {
25+
if (utils.isElectron() && !env.isDev()) {
26+
return process.resourcesPath;
27+
} else {
28+
return join(dirname(fileURLToPath(import.meta.url)), "..", "..");
29+
}
30+
}
31+
1832
function getCurrentLanguage() {
1933
let language;
2034
if (sql_init.isDbInitialized()) {

0 commit comments

Comments
 (0)