mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-03 22:30:51 +08:00
Merge branch 'develop' of ssh://github.com/TriliumNext/Notes into develop
This commit is contained in:
commit
4faf27364f
@ -10,7 +10,13 @@ module.exports = {
|
|||||||
overwrite: true,
|
overwrite: true,
|
||||||
asar: true,
|
asar: true,
|
||||||
icon: "./images/app-icons/icon",
|
icon: "./images/app-icons/icon",
|
||||||
extraResource: getExtraResourcesForPlatform(),
|
extraResource: [
|
||||||
|
// Moved to root
|
||||||
|
...getExtraResourcesForPlatform(),
|
||||||
|
|
||||||
|
// Moved to resources (TriliumNext Notes.app/Contents/Resources on macOS)
|
||||||
|
"translations/"
|
||||||
|
],
|
||||||
afterComplete: [(buildPath, _electronVersion, platform, _arch, callback) => {
|
afterComplete: [(buildPath, _electronVersion, platform, _arch, callback) => {
|
||||||
const extraResources = getExtraResourcesForPlatform();
|
const extraResources = getExtraResourcesForPlatform();
|
||||||
for (const resource of extraResources) {
|
for (const resource of extraResources) {
|
||||||
@ -77,8 +83,7 @@ module.exports = {
|
|||||||
function getExtraResourcesForPlatform() {
|
function getExtraResourcesForPlatform() {
|
||||||
let resources = [
|
let resources = [
|
||||||
'dump-db/',
|
'dump-db/',
|
||||||
'./bin/tpl/anonymize-database.sql',
|
'./bin/tpl/anonymize-database.sql'
|
||||||
'translations/'
|
|
||||||
];
|
];
|
||||||
const scripts = ['trilium-portable', 'trilium-safe-mode', 'trilium-no-cert-check']
|
const scripts = ['trilium-portable', 'trilium-safe-mode', 'trilium-no-cert-check']
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
|
@ -1327,7 +1327,7 @@
|
|||||||
"mermaid-diagram": "Mermaid Diagram",
|
"mermaid-diagram": "Mermaid Diagram",
|
||||||
"canvas": "Canvas",
|
"canvas": "Canvas",
|
||||||
"web-view": "Web View",
|
"web-view": "Web View",
|
||||||
"mind-map": "Mind Map",
|
"mind-map": "Mind Map (Beta)",
|
||||||
"file": "File",
|
"file": "File",
|
||||||
"image": "Image",
|
"image": "Image",
|
||||||
"launcher": "Launcher",
|
"launcher": "Launcher",
|
||||||
|
@ -1317,7 +1317,7 @@
|
|||||||
"mermaid-diagram": "Diagrama Mermaid",
|
"mermaid-diagram": "Diagrama Mermaid",
|
||||||
"canvas": "Lienzo",
|
"canvas": "Lienzo",
|
||||||
"web-view": "Vista Web",
|
"web-view": "Vista Web",
|
||||||
"mind-map": "Mapa Mental",
|
"mind-map": "Mapa Mental (beta)",
|
||||||
"file": "Archivo",
|
"file": "Archivo",
|
||||||
"image": "Imagen",
|
"image": "Imagen",
|
||||||
"launcher": "Lanzador",
|
"launcher": "Lanzador",
|
||||||
|
@ -1291,7 +1291,7 @@
|
|||||||
"canvas": "Schiță",
|
"canvas": "Schiță",
|
||||||
"code": "Cod sursă",
|
"code": "Cod sursă",
|
||||||
"mermaid-diagram": "Diagramă Mermaid",
|
"mermaid-diagram": "Diagramă Mermaid",
|
||||||
"mind-map": "Hartă mentală",
|
"mind-map": "Hartă mentală (beta)",
|
||||||
"note-map": "Hartă notițe",
|
"note-map": "Hartă notițe",
|
||||||
"relation-map": "Hartă relații",
|
"relation-map": "Hartă relații",
|
||||||
"render-note": "Randare notiță",
|
"render-note": "Randare notiță",
|
||||||
@ -1374,7 +1374,7 @@
|
|||||||
"window-on-top": "Menține fereastra mereu vizibilă"
|
"window-on-top": "Menține fereastra mereu vizibilă"
|
||||||
},
|
},
|
||||||
"note_detail": {
|
"note_detail": {
|
||||||
"could_not_find_typewidget": "Nu s-a putut găsi typeWidget-ul pentru tipul „{{type}}”"
|
"could_not_find_typewidget": "Nu s-a putut găsi widget-ul corespunzător tipului „{{type}}”"
|
||||||
},
|
},
|
||||||
"note_title": {
|
"note_title": {
|
||||||
"placeholder": "introduceți titlul notiței aici..."
|
"placeholder": "introduceți titlul notiței aici..."
|
||||||
@ -1387,8 +1387,8 @@
|
|||||||
"snapshot_number_limit_label": "Numărul maxim de revizii pentru notițe:"
|
"snapshot_number_limit_label": "Numărul maxim de revizii pentru notițe:"
|
||||||
},
|
},
|
||||||
"search_result": {
|
"search_result": {
|
||||||
"no_notes_found": "Nu s-a găsit nicio notiță pentru parametrii de căutare dați.",
|
"no_notes_found": "Nu au fost găsite notițe pentru parametrii de căutare dați.",
|
||||||
"search_not_executed": "Căutarea n-a fost încă executată. Clic pe butonul „Căutare” de deasupra pentru a vedea rezultatele."
|
"search_not_executed": "Căutarea n-a fost rulată încă. Clic pe butonul „Căutare” de deasupra pentru a vedea rezultatele."
|
||||||
},
|
},
|
||||||
"show_floating_buttons_button": {
|
"show_floating_buttons_button": {
|
||||||
"button_title": "Afișează butoanele"
|
"button_title": "Afișează butoanele"
|
||||||
|
@ -2,19 +2,33 @@ import i18next from "i18next";
|
|||||||
import Backend from "i18next-fs-backend";
|
import Backend from "i18next-fs-backend";
|
||||||
import options from "./options.js";
|
import options from "./options.js";
|
||||||
import sql_init from "./sql_init.js";
|
import sql_init from "./sql_init.js";
|
||||||
|
import { fileURLToPath } from "url";
|
||||||
|
import { dirname, join } from "path";
|
||||||
|
import utils from "./utils.js";
|
||||||
|
import env from "./env.js";
|
||||||
|
|
||||||
export async function initializeTranslations() {
|
export async function initializeTranslations() {
|
||||||
|
const resourceDir = getResourceDir();
|
||||||
|
|
||||||
// Initialize translations
|
// Initialize translations
|
||||||
await i18next.use(Backend).init({
|
await i18next.use(Backend).init({
|
||||||
lng: getCurrentLanguage(),
|
lng: getCurrentLanguage(),
|
||||||
fallbackLng: "en",
|
fallbackLng: "en",
|
||||||
ns: "server",
|
ns: "server",
|
||||||
backend: {
|
backend: {
|
||||||
loadPath: "translations/{{lng}}/{{ns}}.json"
|
loadPath: join(resourceDir, "translations/{{lng}}/{{ns}}.json")
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getResourceDir() {
|
||||||
|
if (utils.isElectron() && !env.isDev()) {
|
||||||
|
return process.resourcesPath;
|
||||||
|
} else {
|
||||||
|
return join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function getCurrentLanguage() {
|
function getCurrentLanguage() {
|
||||||
let language;
|
let language;
|
||||||
if (sql_init.isDbInitialized()) {
|
if (sql_init.isDbInitialized()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user