From d4965e8d41eb5bd9423ba96e2dadc02e619af99a Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Fri, 31 Jan 2025 22:51:58 +0200 Subject: [PATCH] feat(pdf): improve save filter on Windows --- src/services/window.ts | 3 ++- translations/en/server.json | 3 +++ translations/ro/server.json | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/services/window.ts b/src/services/window.ts index 69fde7c88..5a2dad6c2 100644 --- a/src/services/window.ts +++ b/src/services/window.ts @@ -14,6 +14,7 @@ import { formatDownloadTitle, isDev, isMac, isWindows } from "./utils.js"; import { fileURLToPath } from "url"; import { dirname } from "path"; +import { t } from "i18next"; // Prevent the window being garbage collected let mainWindow: BrowserWindow | null; @@ -61,7 +62,7 @@ ipcMain.on("export-as-pdf", async (e, opts: ExportAsPdfOpts) => { defaultPath: formatDownloadTitle(opts.title, "file", "application/pdf"), filters: [ { - name: "PDF", + name: t("pdf.export_filter"), extensions: [ "pdf" ] } ] diff --git a/translations/en/server.json b/translations/en/server.json index 72836a587..c3ac0dd4a 100644 --- a/translations/en/server.json +++ b/translations/en/server.json @@ -253,5 +253,8 @@ }, "content_renderer": { "note-cannot-be-displayed": "This note type cannot be displayed." + }, + "pdf": { + "export_filter": "PDF Document (*.pdf)" } } diff --git a/translations/ro/server.json b/translations/ro/server.json index 5c1d4b2fd..aec0902a5 100644 --- a/translations/ro/server.json +++ b/translations/ro/server.json @@ -254,5 +254,8 @@ }, "content_renderer": { "note-cannot-be-displayed": "Acest tip de notiță nu poate fi afișat." + }, + "pdf": { + "export_filter": "Document PDF (*.pdf)" } }