mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
desktop: use strings from @notesnook/intl
This commit is contained in:
committed by
Abdullah Atta
parent
8577c32c1f
commit
41eb22b5ca
2586
apps/desktop/package-lock.json
generated
2586
apps/desktop/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -11,6 +11,8 @@
|
|||||||
"repository": "https://github.com/streetwriters/notesnook",
|
"repository": "https://github.com/streetwriters/notesnook",
|
||||||
"license": "GPL-3.0-or-later",
|
"license": "GPL-3.0-or-later",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@lingui/core": "4.11.4",
|
||||||
|
"@notesnook/intl": "file:../../packages/intl",
|
||||||
"@trpc/client": "10.45.2",
|
"@trpc/client": "10.45.2",
|
||||||
"@trpc/server": "10.45.2",
|
"@trpc/server": "10.45.2",
|
||||||
"better-sqlite3-multiple-ciphers": "11.2.1",
|
"better-sqlite3-multiple-ciphers": "11.2.1",
|
||||||
@@ -27,7 +29,7 @@
|
|||||||
"@types/yargs": "^17.0.33",
|
"@types/yargs": "^17.0.33",
|
||||||
"chokidar": "^4.0.1",
|
"chokidar": "^4.0.1",
|
||||||
"electron": "^30.5.1",
|
"electron": "^30.5.1",
|
||||||
"electron-builder": "^25.0.5",
|
"electron-builder": "^25.1.7",
|
||||||
"esbuild": "^0.24.0",
|
"esbuild": "^0.24.0",
|
||||||
"node-abi": "^3.68.0",
|
"node-abi": "^3.68.0",
|
||||||
"node-gyp-build": "^4.8.2",
|
"node-gyp-build": "^4.8.2",
|
||||||
|
|||||||
@@ -36,6 +36,14 @@ import { bringToFront } from "./utils/bring-to-front";
|
|||||||
import { bridge } from "./api/bridge";
|
import { bridge } from "./api/bridge";
|
||||||
import { setupDesktopIntegration } from "./utils/desktop-integration";
|
import { setupDesktopIntegration } from "./utils/desktop-integration";
|
||||||
import { disableCustomDns, enableCustomDns } from "./utils/custom-dns";
|
import { disableCustomDns, enableCustomDns } from "./utils/custom-dns";
|
||||||
|
import { $en, setI18nGlobal, $de } from "@notesnook/intl";
|
||||||
|
import { i18n } from "@lingui/core";
|
||||||
|
i18n.load({
|
||||||
|
en: $en,
|
||||||
|
de: $de
|
||||||
|
});
|
||||||
|
i18n.activate("de");
|
||||||
|
setI18nGlobal(i18n);
|
||||||
|
|
||||||
// only run a single instance
|
// only run a single instance
|
||||||
if (!MAC_APP_STORE && !app.requestSingleInstanceLock()) {
|
if (!MAC_APP_STORE && !app.requestSingleInstanceLock()) {
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ You should have received a copy of the GNU General Public License
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { strings } from "@notesnook/intl";
|
||||||
import { Menu, MenuItem, clipboard, shell } from "electron";
|
import { Menu, MenuItem, clipboard, shell } from "electron";
|
||||||
|
|
||||||
function setupMenu() {
|
function setupMenu() {
|
||||||
@@ -40,7 +41,7 @@ function setupMenu() {
|
|||||||
if (params.misspelledWord) {
|
if (params.misspelledWord) {
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Add to dictionary",
|
label: strings.addToDictionary(),
|
||||||
click: () =>
|
click: () =>
|
||||||
globalThis.window?.webContents.session.addWordToSpellCheckerDictionary(
|
globalThis.window?.webContents.session.addWordToSpellCheckerDictionary(
|
||||||
params.misspelledWord
|
params.misspelledWord
|
||||||
@@ -59,7 +60,7 @@ function setupMenu() {
|
|||||||
if (params.linkURL.length) {
|
if (params.linkURL.length) {
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Open in browser",
|
label: strings.openInBrowser(),
|
||||||
click: () => shell.openExternal(params.linkURL)
|
click: () => shell.openExternal(params.linkURL)
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -68,7 +69,7 @@ function setupMenu() {
|
|||||||
if (params.isEditable) {
|
if (params.isEditable) {
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Undo",
|
label: strings.undo(),
|
||||||
role: "undo",
|
role: "undo",
|
||||||
enabled: params.isEditable,
|
enabled: params.isEditable,
|
||||||
accelerator: "CommandOrControl+Z"
|
accelerator: "CommandOrControl+Z"
|
||||||
@@ -77,7 +78,7 @@ function setupMenu() {
|
|||||||
|
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Redo",
|
label: strings.redo(),
|
||||||
role: "redo",
|
role: "redo",
|
||||||
enabled: params.isEditable,
|
enabled: params.isEditable,
|
||||||
accelerator: "CommandOrControl+Y"
|
accelerator: "CommandOrControl+Y"
|
||||||
@@ -94,7 +95,7 @@ function setupMenu() {
|
|||||||
if (params.isEditable)
|
if (params.isEditable)
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Cut",
|
label: strings.cut(),
|
||||||
role: "cut",
|
role: "cut",
|
||||||
enabled: params.selectionText.length > 0,
|
enabled: params.selectionText.length > 0,
|
||||||
accelerator: "CommandOrControl+X"
|
accelerator: "CommandOrControl+X"
|
||||||
@@ -104,7 +105,7 @@ function setupMenu() {
|
|||||||
if (params.linkURL?.length) {
|
if (params.linkURL?.length) {
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Copy link",
|
label: strings.copyLink(),
|
||||||
click() {
|
click() {
|
||||||
clipboard.writeText(params.linkURL);
|
clipboard.writeText(params.linkURL);
|
||||||
}
|
}
|
||||||
@@ -113,7 +114,7 @@ function setupMenu() {
|
|||||||
|
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Copy link text",
|
label: strings.copyLinkText(),
|
||||||
click() {
|
click() {
|
||||||
clipboard.writeText(params.linkText);
|
clipboard.writeText(params.linkText);
|
||||||
}
|
}
|
||||||
@@ -124,7 +125,7 @@ function setupMenu() {
|
|||||||
if (params.selectionText.length) {
|
if (params.selectionText.length) {
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Copy",
|
label: strings.copy(),
|
||||||
role: "copy",
|
role: "copy",
|
||||||
accelerator: "CommandOrControl+C"
|
accelerator: "CommandOrControl+C"
|
||||||
})
|
})
|
||||||
@@ -135,7 +136,7 @@ function setupMenu() {
|
|||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
id: "copy-image",
|
id: "copy-image",
|
||||||
label: "Copy Image",
|
label: strings.copyImage(),
|
||||||
click() {
|
click() {
|
||||||
globalThis.window?.webContents.copyImageAt(params.x, params.y);
|
globalThis.window?.webContents.copyImageAt(params.x, params.y);
|
||||||
}
|
}
|
||||||
@@ -145,7 +146,7 @@ function setupMenu() {
|
|||||||
if (params.isEditable)
|
if (params.isEditable)
|
||||||
menu.append(
|
menu.append(
|
||||||
new MenuItem({
|
new MenuItem({
|
||||||
label: "Paste",
|
label: strings.paste(),
|
||||||
role: "pasteAndMatchStyle",
|
role: "pasteAndMatchStyle",
|
||||||
enabled: clipboard.readText("clipboard").length > 0,
|
enabled: clipboard.readText("clipboard").length > 0,
|
||||||
accelerator: "CommandOrControl+V"
|
accelerator: "CommandOrControl+V"
|
||||||
|
|||||||
Reference in New Issue
Block a user