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",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@lingui/core": "4.11.4",
|
||||
"@notesnook/intl": "file:../../packages/intl",
|
||||
"@trpc/client": "10.45.2",
|
||||
"@trpc/server": "10.45.2",
|
||||
"better-sqlite3-multiple-ciphers": "11.2.1",
|
||||
@@ -27,7 +29,7 @@
|
||||
"@types/yargs": "^17.0.33",
|
||||
"chokidar": "^4.0.1",
|
||||
"electron": "^30.5.1",
|
||||
"electron-builder": "^25.0.5",
|
||||
"electron-builder": "^25.1.7",
|
||||
"esbuild": "^0.24.0",
|
||||
"node-abi": "^3.68.0",
|
||||
"node-gyp-build": "^4.8.2",
|
||||
|
||||
@@ -36,6 +36,14 @@ import { bringToFront } from "./utils/bring-to-front";
|
||||
import { bridge } from "./api/bridge";
|
||||
import { setupDesktopIntegration } from "./utils/desktop-integration";
|
||||
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
|
||||
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/>.
|
||||
*/
|
||||
|
||||
import { strings } from "@notesnook/intl";
|
||||
import { Menu, MenuItem, clipboard, shell } from "electron";
|
||||
|
||||
function setupMenu() {
|
||||
@@ -40,7 +41,7 @@ function setupMenu() {
|
||||
if (params.misspelledWord) {
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Add to dictionary",
|
||||
label: strings.addToDictionary(),
|
||||
click: () =>
|
||||
globalThis.window?.webContents.session.addWordToSpellCheckerDictionary(
|
||||
params.misspelledWord
|
||||
@@ -59,7 +60,7 @@ function setupMenu() {
|
||||
if (params.linkURL.length) {
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Open in browser",
|
||||
label: strings.openInBrowser(),
|
||||
click: () => shell.openExternal(params.linkURL)
|
||||
})
|
||||
);
|
||||
@@ -68,7 +69,7 @@ function setupMenu() {
|
||||
if (params.isEditable) {
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Undo",
|
||||
label: strings.undo(),
|
||||
role: "undo",
|
||||
enabled: params.isEditable,
|
||||
accelerator: "CommandOrControl+Z"
|
||||
@@ -77,7 +78,7 @@ function setupMenu() {
|
||||
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Redo",
|
||||
label: strings.redo(),
|
||||
role: "redo",
|
||||
enabled: params.isEditable,
|
||||
accelerator: "CommandOrControl+Y"
|
||||
@@ -94,7 +95,7 @@ function setupMenu() {
|
||||
if (params.isEditable)
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Cut",
|
||||
label: strings.cut(),
|
||||
role: "cut",
|
||||
enabled: params.selectionText.length > 0,
|
||||
accelerator: "CommandOrControl+X"
|
||||
@@ -104,7 +105,7 @@ function setupMenu() {
|
||||
if (params.linkURL?.length) {
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Copy link",
|
||||
label: strings.copyLink(),
|
||||
click() {
|
||||
clipboard.writeText(params.linkURL);
|
||||
}
|
||||
@@ -113,7 +114,7 @@ function setupMenu() {
|
||||
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Copy link text",
|
||||
label: strings.copyLinkText(),
|
||||
click() {
|
||||
clipboard.writeText(params.linkText);
|
||||
}
|
||||
@@ -124,7 +125,7 @@ function setupMenu() {
|
||||
if (params.selectionText.length) {
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Copy",
|
||||
label: strings.copy(),
|
||||
role: "copy",
|
||||
accelerator: "CommandOrControl+C"
|
||||
})
|
||||
@@ -135,7 +136,7 @@ function setupMenu() {
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
id: "copy-image",
|
||||
label: "Copy Image",
|
||||
label: strings.copyImage(),
|
||||
click() {
|
||||
globalThis.window?.webContents.copyImageAt(params.x, params.y);
|
||||
}
|
||||
@@ -145,7 +146,7 @@ function setupMenu() {
|
||||
if (params.isEditable)
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
label: "Paste",
|
||||
label: strings.paste(),
|
||||
role: "pasteAndMatchStyle",
|
||||
enabled: clipboard.readText("clipboard").length > 0,
|
||||
accelerator: "CommandOrControl+V"
|
||||
|
||||
Reference in New Issue
Block a user