From e875edfd5782d7b9f059c86b7d6f0628aa3d8734 Mon Sep 17 00:00:00 2001 From: Xiaoqi_Weng <50273091+zjnbwxq@users.noreply.github.com> Date: Mon, 21 Oct 2024 03:52:37 +0100 Subject: [PATCH] feat: add export to Obsidian feature (#998) Co-authored-by: zjnbwxq Co-authored-by: Stephen Zhou <38493346+hyoban@users.noreply.github.com> --- apps/main/src/tipc/app.ts | 42 +++++++++++++++ .../src/atoms/settings/integration.ts | 4 ++ .../ui/platform-icon/collections/obsidian.tsx | 18 +++++++ .../src/components/ui/platform-icon/icons.ts | 1 + .../src/hooks/biz/useEntryActions.tsx | 54 +++++++++++++++++++ .../src/modules/settings/tabs/integration.tsx | 19 +++++++ locales/app/ar-DZ.json | 3 ++ locales/app/ar-IQ.json | 3 ++ locales/app/ar-KW.json | 3 ++ locales/app/ar-MA.json | 5 +- locales/app/de.json | 3 ++ locales/app/en.json | 3 ++ locales/app/es.json | 3 ++ locales/app/zh-CN.json | 3 ++ locales/app/zh-HK.json | 9 ++-- locales/app/zh-TW.json | 3 ++ locales/settings/ar-DZ.json | 5 ++ locales/settings/ar-IQ.json | 5 ++ locales/settings/ar-KW.json | 5 ++ locales/settings/ar-MA.json | 7 ++- locales/settings/de.json | 5 ++ locales/settings/en.json | 5 ++ locales/settings/es.json | 5 ++ locales/settings/zh-CN.json | 5 ++ locales/settings/zh-HK.json | 5 ++ locales/settings/zh-TW.json | 7 ++- packages/shared/src/interface/settings.ts | 4 ++ 27 files changed, 228 insertions(+), 6 deletions(-) create mode 100644 apps/renderer/src/components/ui/platform-icon/collections/obsidian.tsx diff --git a/apps/main/src/tipc/app.ts b/apps/main/src/tipc/app.ts index 58761890f5..d932e86ff9 100644 --- a/apps/main/src/tipc/app.ts +++ b/apps/main/src/tipc/app.ts @@ -1,3 +1,5 @@ +import fs from "node:fs" +import fsp from "node:fs/promises" import path from "node:path" import { getRendererHandlers } from "@egoist/tipc/main" @@ -225,6 +227,46 @@ export const appRoute = { }), clearAllData: t.procedure.action(clearAllData), + + saveToObsidian: t.procedure + .input<{ + url: string + title: string + content: string + author: string + publishedAt: string + vaultPath: string + }>() + .action(async ({ input }) => { + try { + const { url, title, content, author, publishedAt, vaultPath } = input + + const fileName = `${(title || publishedAt).trim().slice(0, 20)}.md` + const filePath = path.join(vaultPath, fileName) + const exists = fs.existsSync(filePath) + if (exists) { + return { success: false, error: "File already exists" } + } + + const markdown = `--- +url: ${url} +author: ${author} +publishedAt: ${publishedAt} +--- + +# ${title} + +${content} +` + + await fsp.writeFile(filePath, markdown, "utf-8") + return { success: true } + } catch (error) { + console.error("Failed to save to Obsidian:", error) + const errorMessage = error instanceof Error ? error.message : String(error) + return { success: false, error: errorMessage } + } + }), } interface Sender extends Electron.WebContents { diff --git a/apps/renderer/src/atoms/settings/integration.ts b/apps/renderer/src/atoms/settings/integration.ts index dff5ec8dac..f54a02ace6 100644 --- a/apps/renderer/src/atoms/settings/integration.ts +++ b/apps/renderer/src/atoms/settings/integration.ts @@ -19,6 +19,10 @@ export const createDefaultSettings = (): IntegrationSettings => ({ enableOmnivore: false, omnivoreEndpoint: "", omnivoreToken: "", + + // obsidian + enableObsidian: false, + obsidianVaultPath: "", }) export const { diff --git a/apps/renderer/src/components/ui/platform-icon/collections/obsidian.tsx b/apps/renderer/src/components/ui/platform-icon/collections/obsidian.tsx new file mode 100644 index 0000000000..0b90a91bb0 --- /dev/null +++ b/apps/renderer/src/components/ui/platform-icon/collections/obsidian.tsx @@ -0,0 +1,18 @@ +import type { SVGProps } from "react" + +export function SimpleIconsObsidian(props: SVGProps) { + return ( + + + + ) +} diff --git a/apps/renderer/src/components/ui/platform-icon/icons.ts b/apps/renderer/src/components/ui/platform-icon/icons.ts index a6aa151f77..084815395f 100644 --- a/apps/renderer/src/components/ui/platform-icon/icons.ts +++ b/apps/renderer/src/components/ui/platform-icon/icons.ts @@ -1,5 +1,6 @@ export * from "./collections/eagle" export * from "./collections/instapaper" +export * from "./collections/obsidian" export * from "./collections/omnivore" export * from "./collections/readwise" export * from "./collections/rss3" diff --git a/apps/renderer/src/hooks/biz/useEntryActions.tsx b/apps/renderer/src/hooks/biz/useEntryActions.tsx index d4d9dc0c27..1d8d19794a 100644 --- a/apps/renderer/src/hooks/biz/useEntryActions.tsx +++ b/apps/renderer/src/hooks/biz/useEntryActions.tsx @@ -25,6 +25,7 @@ import { mountLottie } from "~/components/ui/lottie-container" import { SimpleIconsEagle, SimpleIconsInstapaper, + SimpleIconsObsidian, SimpleIconsOmnivore, SimpleIconsReadwise, } from "~/components/ui/platform-icon/icons" @@ -171,6 +172,34 @@ export const useEntryActions = ({ const enableOmnivore = useIntegrationSettingKey("enableOmnivore") const omnivoreToken = useIntegrationSettingKey("omnivoreToken") const omnivoreEndpoint = useIntegrationSettingKey("omnivoreEndpoint") + const enableObsidian = useIntegrationSettingKey("enableObsidian") + const obsidianVaultPath = useIntegrationSettingKey("obsidianVaultPath") + const isObsidianEnabled = enableObsidian && !!obsidianVaultPath + + const saveToObsidian = useMutation({ + mutationKey: ["save-to-obsidian"], + mutationFn: async (data: { + url: string + title: string + content: string + author: string + publishedAt: string + vaultPath: string + }) => { + return await tipcClient?.saveToObsidian(data) + }, + onSuccess: (data) => { + if (data?.success) { + toast.success(t("entry_actions.saved_to_obsidian"), { + duration: 3000, + }) + } else { + toast.error(`${t("entry_actions.failed_to_save_to_obsidian")}: ${data?.error}`, { + duration: 3000, + }) + } + }, + }) const checkEagle = useQuery({ queryKey: ["check-eagle"], @@ -370,6 +399,24 @@ export const useEntryActions = ({ } }, }, + { + name: t("entry_actions.save_to_obsidian"), + icon: , + key: "saveToObsidian", + hide: !isObsidianEnabled || !populatedEntry?.entries?.url, + onClick: () => { + if (!isObsidianEnabled || !populatedEntry?.entries?.url) return + + saveToObsidian.mutate({ + url: populatedEntry.entries.url, + title: populatedEntry.entries.title || "", + content: populatedEntry.entries.content || "", + author: populatedEntry.entries.author || "", + publishedAt: populatedEntry.entries.publishedAt || "", + vaultPath: obsidianVaultPath, + }) + }, + }, { key: "tip", shortcut: shortcuts.entry.tip.key, @@ -534,9 +581,16 @@ export const useEntryActions = ({ enableInstapaper, instapaperPassword, instapaperUsername, + enableOmnivore, + omnivoreToken, + omnivoreEndpoint, + isObsidianEnabled, + isInbox, feed?.ownerUserId, type, showSourceContent, + obsidianVaultPath, + saveToObsidian, openTipModal, collect, uncollect, diff --git a/apps/renderer/src/modules/settings/tabs/integration.tsx b/apps/renderer/src/modules/settings/tabs/integration.tsx index 0d54800235..90f61b9da3 100644 --- a/apps/renderer/src/modules/settings/tabs/integration.tsx +++ b/apps/renderer/src/modules/settings/tabs/integration.tsx @@ -7,6 +7,7 @@ import { Divider } from "~/components/ui/divider" import { SimpleIconsEagle, SimpleIconsInstapaper, + SimpleIconsObsidian, SimpleIconsOmnivore, SimpleIconsReadwise, } from "~/components/ui/platform-icon/icons" @@ -151,6 +152,24 @@ export const SettingIntegration = () => { ), }), + { + type: "title", + value: ( + + + {t("integration.obsidian.title")} + + ), + }, + defineSettingItem("enableObsidian", { + label: t("integration.obsidian.enable.label"), + description: t("integration.obsidian.enable.description"), + }), + defineSettingItem("obsidianVaultPath", { + label: t("integration.obsidian.vaultPath.label"), + vertical: true, + description: t("integration.obsidian.vaultPath.description"), + }), BottomTip, ]} diff --git a/locales/app/ar-DZ.json b/locales/app/ar-DZ.json index 4a57067e38..04eb81068d 100644 --- a/locales/app/ar-DZ.json +++ b/locales/app/ar-DZ.json @@ -17,15 +17,18 @@ "entry_actions.copy_link": "نسخ الرابط", "entry_actions.failed_to_save_to_eagle": "فشل في الحفظ إلى Eagle.", "entry_actions.failed_to_save_to_instapaper": "فشل في الحفظ إلى Instapaper.", + "entry_actions.failed_to_save_to_obsidian": "فشل في الحفظ إلى Obsidian.", "entry_actions.failed_to_save_to_readwise": "فشل في الحفظ إلى Readwise.", "entry_actions.mark_as_read": "تحديد كمقروء", "entry_actions.mark_as_unread": "تحديد كغير مقروء", "entry_actions.open_in_browser": "فتح في المتصفح", "entry_actions.save_media_to_eagle": "حفظ الوسائط إلى Eagle", "entry_actions.save_to_instapaper": "حفظ إلى Instapaper", + "entry_actions.save_to_obsidian": "حفظ إلى Obsidian", "entry_actions.save_to_readwise": "حفظ إلى Readwise", "entry_actions.saved_to_eagle": "تم الحفظ إلى Eagle.", "entry_actions.saved_to_instapaper": "تم الحفظ إلى Instapaper.", + "entry_actions.saved_to_obsidian": "تم الحفظ إلى Obsidian.", "entry_actions.saved_to_readwise": "تم الحفظ إلى Readwise.", "entry_actions.share": "مشاركة", "entry_actions.star": "تمييز بنجمة", diff --git a/locales/app/ar-IQ.json b/locales/app/ar-IQ.json index 98d12b9f99..49b2357d28 100644 --- a/locales/app/ar-IQ.json +++ b/locales/app/ar-IQ.json @@ -17,15 +17,18 @@ "entry_actions.copy_link": "نسخ الرابط", "entry_actions.failed_to_save_to_eagle": "فشل في الحفظ إلى Eagle.", "entry_actions.failed_to_save_to_instapaper": "فشل في الحفظ إلى Instapaper.", + "entry_actions.failed_to_save_to_obsidian": "فشل في الحفظ إلى Obsidian.", "entry_actions.failed_to_save_to_readwise": "فشل في الحفظ إلى Readwise.", "entry_actions.mark_as_read": "تحديد كمقروء", "entry_actions.mark_as_unread": "تحديد كغير مقروء", "entry_actions.open_in_browser": "فتح في المتصفح", "entry_actions.save_media_to_eagle": "حفظ الوسائط إلى Eagle", "entry_actions.save_to_instapaper": "حفظ إلى Instapaper", + "entry_actions.save_to_obsidian": "حفظ إلى Obsidian", "entry_actions.save_to_readwise": "حفظ إلى Readwise", "entry_actions.saved_to_eagle": "تم الحفظ إلى Eagle.", "entry_actions.saved_to_instapaper": "تم الحفظ إلى Instapaper.", + "entry_actions.saved_to_obsidian": "تم الحفظ إلى Obsidian.", "entry_actions.saved_to_readwise": "تم الحفظ إلى Readwise.", "entry_actions.share": "مشاركة", "entry_actions.star": "إضافة إلى المفضلة", diff --git a/locales/app/ar-KW.json b/locales/app/ar-KW.json index 6b6271848e..4913cd44db 100644 --- a/locales/app/ar-KW.json +++ b/locales/app/ar-KW.json @@ -17,15 +17,18 @@ "entry_actions.copy_link": "نسخ الرابط", "entry_actions.failed_to_save_to_eagle": "فشل في الحفظ إلى Eagle.", "entry_actions.failed_to_save_to_instapaper": "فشل في الحفظ إلى Instapaper.", + "entry_actions.failed_to_save_to_obsidian": "فشل في الحفظ إلى Obsidian", "entry_actions.failed_to_save_to_readwise": "فشل في الحفظ إلى Readwise.", "entry_actions.mark_as_read": "وضع علامة كمقروء", "entry_actions.mark_as_unread": "وضع علامة كغير مقروء", "entry_actions.open_in_browser": "فتح في المتصفح", "entry_actions.save_media_to_eagle": "حفظ الوسائط إلى Eagle", "entry_actions.save_to_instapaper": "حفظ إلى Instapaper", + "entry_actions.save_to_obsidian": "حفظ إلى Obsidian", "entry_actions.save_to_readwise": "حفظ إلى Readwise", "entry_actions.saved_to_eagle": "تم الحفظ إلى Eagle.", "entry_actions.saved_to_instapaper": "تم الحفظ إلى Instapaper.", + "entry_actions.saved_to_obsidian": "تم الحفظ إلى Obsidian.", "entry_actions.saved_to_readwise": "تم الحفظ إلى Readwise.", "entry_actions.share": "مشاركة", "entry_actions.star": "تفضيل", diff --git a/locales/app/ar-MA.json b/locales/app/ar-MA.json index d2c58f31eb..83a9676d73 100644 --- a/locales/app/ar-MA.json +++ b/locales/app/ar-MA.json @@ -17,16 +17,19 @@ "entry_actions.copy_link": "نسخ الرابط", "entry_actions.failed_to_save_to_eagle": "فشل الحفظ إلى Eagle.", "entry_actions.failed_to_save_to_instapaper": "فشل الحفظ إلى Instapaper.", + "entry_actions.failed_to_save_to_obsidian": "فشل الحفظ في Obsidian", "entry_actions.failed_to_save_to_readwise": "فشل الحفظ إلى Readwise.", "entry_actions.mark_as_read": "وضع علامة كمقروء", "entry_actions.mark_as_unread": "وضع علامة كغير مقروء", "entry_actions.open_in_browser": "فتح في المتصفح", "entry_actions.save_media_to_eagle": "حفظ الوسائط إلى Eagle", "entry_actions.save_to_instapaper": "حفظ إلى Instapaper", + "entry_actions.save_to_obsidian": "حفظ في Obsidian", "entry_actions.save_to_readwise": "حفظ إلى Readwise", "entry_actions.saved_to_eagle": "تم الحفظ إلى Eagle.", "entry_actions.saved_to_instapaper": "تم الحفظ إلى Instapaper.", - "entry_actions.saved_to_readwise": "تم الحفظ إلى Readwise.", + "entry_actions.saved_to_obsidian": "تم الحفظ في Obsidian", + "entry_actions.saved_to_readwise": "تم الحفظ في Readwise.", "entry_actions.share": "مشاركة", "entry_actions.star": "إضافة إلى المفضلة", "entry_actions.starred": "مضاف إلى المفضلة.", diff --git a/locales/app/de.json b/locales/app/de.json index 1c85f4d7c5..5fbdc871ef 100644 --- a/locales/app/de.json +++ b/locales/app/de.json @@ -17,15 +17,18 @@ "entry_actions.copy_link": "Link kopieren", "entry_actions.failed_to_save_to_eagle": "Speichern in Eagle fehlgeschlagen.", "entry_actions.failed_to_save_to_instapaper": "Speichern in Instapaper fehlgeschlagen.", + "entry_actions.failed_to_save_to_obsidian": "Speichern in Obsidian fehlgeschlagen", "entry_actions.failed_to_save_to_readwise": "Speichern in Readwise fehlgeschlagen.", "entry_actions.mark_as_read": "Als gelesen markieren", "entry_actions.mark_as_unread": "Als ungelesen markieren", "entry_actions.open_in_browser": "Im Browser öffnen", "entry_actions.save_media_to_eagle": "Medien in Eagle speichern", "entry_actions.save_to_instapaper": "In Instapaper speichern", + "entry_actions.save_to_obsidian": "In Obsidian speichern", "entry_actions.save_to_readwise": "In Readwise speichern", "entry_actions.saved_to_eagle": "In Eagle gespeichert.", "entry_actions.saved_to_instapaper": "In Instapaper gespeichert.", + "entry_actions.saved_to_obsidian": "In Obsidian gespeichert", "entry_actions.saved_to_readwise": "In Readwise gespeichert.", "entry_actions.share": "Teilen", "entry_actions.star": "Favorisieren", diff --git a/locales/app/en.json b/locales/app/en.json index 1ecbccf18c..4b6a606871 100644 --- a/locales/app/en.json +++ b/locales/app/en.json @@ -59,6 +59,7 @@ "entry_actions.copy_title": "Copy Title", "entry_actions.failed_to_save_to_eagle": "Failed to save to Eagle.", "entry_actions.failed_to_save_to_instapaper": "Failed to save to Instapaper.", + "entry_actions.failed_to_save_to_obsidian": "Failed to save to Obsidian", "entry_actions.failed_to_save_to_omnivore": "Failed to save to Omnivore.", "entry_actions.failed_to_save_to_readwise": "Failed to save to Readwise.", "entry_actions.mark_as_read": "Mark as Read", @@ -67,10 +68,12 @@ "entry_actions.recent_reader": "Recent reader:", "entry_actions.save_media_to_eagle": "Save Media To Eagle", "entry_actions.save_to_instapaper": "Save To Instapaper", + "entry_actions.save_to_obsidian": "Save to Obsidian", "entry_actions.save_to_omnivore": "Save To Omnivore", "entry_actions.save_to_readwise": "Save To Readwise", "entry_actions.saved_to_eagle": "Saved To Eagle.", "entry_actions.saved_to_instapaper": "Saved To Instapaper.", + "entry_actions.saved_to_obsidian": "Saved to Obsidian", "entry_actions.saved_to_omnivore": "Saved To Omnivore.", "entry_actions.saved_to_readwise": "Saved To Readwise.", "entry_actions.share": "Share", diff --git a/locales/app/es.json b/locales/app/es.json index 4d51fd0779..4fe26cad13 100644 --- a/locales/app/es.json +++ b/locales/app/es.json @@ -15,12 +15,15 @@ "discover.rss_url": "RSS URL", "discover.select_placeholder": "Seleccionar", "entry_actions.copy_link": "Copiar enlace", + "entry_actions.failed_to_save_to_obsidian": "Error al guardar en Obsidian", "entry_actions.mark_as_read": "Marcar como leído", "entry_actions.mark_as_unread": "Marcar como no leído", "entry_actions.open_in_browser": "Abrir en el navegador", "entry_actions.save_media_to_eagle": "Guardar medios en Eagle", "entry_actions.save_to_instapaper": "Guardar en Instapaper", + "entry_actions.save_to_obsidian": "Guardar en Obsidian", "entry_actions.save_to_readwise": "Guardar en Readwise", + "entry_actions.saved_to_obsidian": "Guardado en Obsidian", "entry_actions.share": "Compartir", "entry_actions.star": "Agregar a favoritos", "entry_actions.tip": "Dar propina", diff --git a/locales/app/zh-CN.json b/locales/app/zh-CN.json index 24a3afbc9d..6b57aac6b4 100644 --- a/locales/app/zh-CN.json +++ b/locales/app/zh-CN.json @@ -55,6 +55,7 @@ "entry_actions.copy_title": "复制标题", "entry_actions.failed_to_save_to_eagle": "保存到 Eagle 失败", "entry_actions.failed_to_save_to_instapaper": "保存到 Instapaper 失败", + "entry_actions.failed_to_save_to_obsidian": "保存到 Obsidian 失败", "entry_actions.failed_to_save_to_omnivore": "保存到 Omnivore 失败", "entry_actions.failed_to_save_to_readwise": "保存到 Readwise 失败", "entry_actions.mark_as_read": "标记为已读", @@ -63,10 +64,12 @@ "entry_actions.recent_reader": "最近阅读者:", "entry_actions.save_media_to_eagle": "保存到 Eagle", "entry_actions.save_to_instapaper": "保存到 Instapaper", + "entry_actions.save_to_obsidian": "保存到 Obsidian", "entry_actions.save_to_omnivore": "保存到 Omnivore", "entry_actions.save_to_readwise": "保存到 Readwise", "entry_actions.saved_to_eagle": "保存到 Eagle", "entry_actions.saved_to_instapaper": "保存到 Instapaper.", + "entry_actions.saved_to_obsidian": "已保存到 Obsidian", "entry_actions.saved_to_omnivore": "保存到 Omnivore.", "entry_actions.saved_to_readwise": "保存到 Readwise.", "entry_actions.share": "分享", diff --git a/locales/app/zh-HK.json b/locales/app/zh-HK.json index bedbae4ce8..1ea7260767 100644 --- a/locales/app/zh-HK.json +++ b/locales/app/zh-HK.json @@ -55,6 +55,7 @@ "entry_actions.copy_title": "複製標題", "entry_actions.failed_to_save_to_eagle": "無法保存至 Eagle", "entry_actions.failed_to_save_to_instapaper": "無法保存至 Instapaper", + "entry_actions.failed_to_save_to_obsidian": "儲存至 Obsidian 失敗", "entry_actions.failed_to_save_to_omnivore": "無法保存至 Omnivore", "entry_actions.failed_to_save_to_readwise": "無法保存至 Readwise", "entry_actions.mark_as_read": "標記為已讀", @@ -63,12 +64,14 @@ "entry_actions.recent_reader": "最近閱讀者:", "entry_actions.save_media_to_eagle": "保存媒體至 Eagle", "entry_actions.save_to_instapaper": "保存至 Instapaper", + "entry_actions.save_to_obsidian": "儲存至 Obsidian", "entry_actions.save_to_omnivore": "保存至 Omnivore", - "entry_actions.save_to_readwise": "保存至 Readwise", + "entry_actions.save_to_readwise": "儲存至 Readwise", "entry_actions.saved_to_eagle": "已保存至 Eagle", "entry_actions.saved_to_instapaper": "已保存至 Instapaper", + "entry_actions.saved_to_obsidian": "已儲存至 Obsidian", "entry_actions.saved_to_omnivore": "已保存至 Omnivore", - "entry_actions.saved_to_readwise": "已保存至 Readwise", + "entry_actions.saved_to_readwise": "已儲存至 Readwise", "entry_actions.share": "分享", "entry_actions.star": "收藏", "entry_actions.starred": "已收藏", @@ -197,7 +200,7 @@ "sidebar.add_more_feeds": "添加訂閱源", "sidebar.category_remove_dialog.cancel": "取消", "sidebar.category_remove_dialog.continue": "繼續", - "sidebar.category_remove_dialog.description": "此操作將刪除你的分類,但其中的訂閱源將保留並按網站分組。", + "sidebar.category_remove_dialog.description": "此操作將刪除你的分類,但其中的訂閱源將留並按網站分組。", "sidebar.category_remove_dialog.title": "刪除分類", "sidebar.feed_actions.claim": "認領", "sidebar.feed_actions.claim_feed": "認領訂閱源", diff --git a/locales/app/zh-TW.json b/locales/app/zh-TW.json index ba3cba4be2..f05cac3719 100644 --- a/locales/app/zh-TW.json +++ b/locales/app/zh-TW.json @@ -55,6 +55,7 @@ "entry_actions.copy_title": "複製標題", "entry_actions.failed_to_save_to_eagle": "無法儲存到 Eagle。", "entry_actions.failed_to_save_to_instapaper": "無法儲存到 Instapaper。", + "entry_actions.failed_to_save_to_obsidian": "儲存到 Obsidian 失敗", "entry_actions.failed_to_save_to_omnivore": "無法儲存到 Omnivore。", "entry_actions.failed_to_save_to_readwise": "無法儲存到 Readwise。", "entry_actions.mark_as_read": "標記為已讀", @@ -63,10 +64,12 @@ "entry_actions.recent_reader": "最近閲讀者:", "entry_actions.save_media_to_eagle": "儲存媒體至 Eagle", "entry_actions.save_to_instapaper": "儲存到 Instapaper", + "entry_actions.save_to_obsidian": "儲存到 Obsidian", "entry_actions.save_to_omnivore": "儲存到 Omnivore", "entry_actions.save_to_readwise": "儲存到 Readwise", "entry_actions.saved_to_eagle": "已儲存至 Eagle。", "entry_actions.saved_to_instapaper": "已儲存至 Instapaper。", + "entry_actions.saved_to_obsidian": "已儲存到 Obsidian", "entry_actions.saved_to_omnivore": "已儲存至 Omnivore。", "entry_actions.saved_to_readwise": "已儲存至 Readwise。", "entry_actions.share": "分享", diff --git a/locales/settings/ar-DZ.json b/locales/settings/ar-DZ.json index 1cde8829eb..f5d2e7176c 100644 --- a/locales/settings/ar-DZ.json +++ b/locales/settings/ar-DZ.json @@ -109,6 +109,11 @@ "integration.instapaper.password.label": "كلمة مرور Instapaper", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "اسم مستخدم Instapaper", + "integration.obsidian.enable.description": "عرض زر 'حفظ إلى Obsidian' عند توفره.", + "integration.obsidian.enable.label": "تمكين", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "المسار إلى خزنة Obsidian الخاصة بك.", + "integration.obsidian.vaultPath.label": "مسار خزنة Obsidian", "integration.readwise.enable.description": "عرض زر 'حفظ إلى Readwise' عند توفره.", "integration.readwise.enable.label": "تمكين", "integration.readwise.title": "Readwise", diff --git a/locales/settings/ar-IQ.json b/locales/settings/ar-IQ.json index f28350e614..14226a1e24 100644 --- a/locales/settings/ar-IQ.json +++ b/locales/settings/ar-IQ.json @@ -115,6 +115,11 @@ "integration.instapaper.password.label": "كلمة مرور Instapaper", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "اسم مستخدم Instapaper", + "integration.obsidian.enable.description": "عرض زر 'حفظ إلى Obsidian' عند توفره.", + "integration.obsidian.enable.label": "تمكين", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "المسار إلى خزنة Obsidian الخاصة بك.", + "integration.obsidian.vaultPath.label": "مسار خزنة Obsidian", "integration.readwise.enable.description": "عرض زر 'حفظ إلى Readwise' عند توفره.", "integration.readwise.enable.label": "تمكين", "integration.readwise.title": "Readwise", diff --git a/locales/settings/ar-KW.json b/locales/settings/ar-KW.json index 336338690c..f378441671 100644 --- a/locales/settings/ar-KW.json +++ b/locales/settings/ar-KW.json @@ -115,6 +115,11 @@ "integration.instapaper.password.label": "كلمة مرور Instapaper", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "اسم مستخدم Instapaper", + "integration.obsidian.enable.description": "عرض زر 'حفظ إلى Obsidian' عند توفره.", + "integration.obsidian.enable.label": "تمكين", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "المسار إلى خزنة Obsidian الخاصة بك.", + "integration.obsidian.vaultPath.label": "مسار خزنة Obsidian", "integration.readwise.enable.description": "عرض زر 'حفظ إلى Readwise' عند توفره.", "integration.readwise.enable.label": "تمكين", "integration.readwise.title": "Readwise", diff --git a/locales/settings/ar-MA.json b/locales/settings/ar-MA.json index 95146c6570..c15e4203aa 100644 --- a/locales/settings/ar-MA.json +++ b/locales/settings/ar-MA.json @@ -109,11 +109,16 @@ "integration.instapaper.password.label": "كلمة مرور Instapaper", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "اسم مستخدم Instapaper", + "integration.obsidian.enable.description": "عرض زر 'حفظ في Obsidian' إلا كان متوفر.", + "integration.obsidian.enable.label": "تشغيل", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "المسار لخزنة Obsidian ديالك.", + "integration.obsidian.vaultPath.label": "مسار خزنة Obsidian", "integration.readwise.enable.description": "عرض زر 'حفظ إلى Readwise' إلا كان متوفر.", "integration.readwise.enable.label": "تشغيل", "integration.readwise.title": "Readwise", "integration.readwise.token.description": "يمكنك الحصول عليه هنا: ", - "integration.readwise.token.label": "رمز الوصول إلى Readwise", + "integration.readwise.token.label": "رمز الوصول لـ Readwise", "integration.sidebar_title": "التكامل", "integration.tip": "نصيحة: البيانات الحساسة ديالك كتحفظ محليا وما كتترفعش للسيرفر.", "integration.title": "التكامل", diff --git a/locales/settings/de.json b/locales/settings/de.json index e1595ddfce..d96476bb96 100644 --- a/locales/settings/de.json +++ b/locales/settings/de.json @@ -121,6 +121,11 @@ "integration.instapaper.password.label": "Instapaper Passwort", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "Instapaper Benutzername", + "integration.obsidian.enable.description": "Zeige den Button „In Obsidian speichern, wenn erfügbar.", + "integration.obsidian.enable.label": "Aktivieren", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "Der Pfad zu Ihrem Obsidian Vault.", + "integration.obsidian.vaultPath.label": "Obsidian Vault-Pfad", "integration.readwise.enable.description": "Zeige den Button „Zu Readwise speichern“, wenn verfügbar.", "integration.readwise.enable.label": "Aktivieren", "integration.readwise.title": "Readwise", diff --git a/locales/settings/en.json b/locales/settings/en.json index f916c08311..c625184e0a 100644 --- a/locales/settings/en.json +++ b/locales/settings/en.json @@ -129,6 +129,11 @@ "integration.instapaper.password.label": "Instapaper Password", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "Instapaper Username", + "integration.obsidian.enable.description": "Display 'Save to Obsidian' button when available.", + "integration.obsidian.enable.label": "Enable", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "The path to your Obsidian vault.", + "integration.obsidian.vaultPath.label": "Obsidian Vault Path", "integration.omnivore.enable.description": "Display 'Save to Omnivore' button when available.", "integration.omnivore.enable.label": "Enable", "integration.omnivore.endpoint.description": "Omnivore Official Endpoint is: ", diff --git a/locales/settings/es.json b/locales/settings/es.json index 73d99acca1..707edd8923 100644 --- a/locales/settings/es.json +++ b/locales/settings/es.json @@ -109,6 +109,11 @@ "integration.instapaper.password.label": "Contraseña de Instapaper", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "Usuario de Instapaper", + "integration.obsidian.enable.description": "Mostrar el botón 'Guardar en Obsidian' cuando esté disponible.", + "integration.obsidian.enable.label": "Habilitar", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "La ruta a tu bóveda de Obsidian.", + "integration.obsidian.vaultPath.label": "Ruta de la bóveda de Obsidian", "integration.readwise.enable.description": "Mostrar el botón 'Guardar en Readwise' cuando esté disponible.", "integration.readwise.enable.label": "Habilitar", "integration.readwise.title": "Readwise", diff --git a/locales/settings/zh-CN.json b/locales/settings/zh-CN.json index 48f880d8aa..d95682706a 100644 --- a/locales/settings/zh-CN.json +++ b/locales/settings/zh-CN.json @@ -128,6 +128,11 @@ "integration.instapaper.password.label": "密码", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "Instapaper 用户名", + "integration.obsidian.enable.description": "显示保存到Obsidian按钮(如果可用)", + "integration.obsidian.enable.label": "启用", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "你的 Obsidian 仓库的路径", + "integration.obsidian.vaultPath.label": "Obsidian 仓库路径", "integration.omnivore.enable.description": "显示\"保存到 Omnivore\"按钮(如果可用)", "integration.omnivore.enable.label": "启用", "integration.omnivore.endpoint.description": "Omnivore 官方接口", diff --git a/locales/settings/zh-HK.json b/locales/settings/zh-HK.json index 8a3ed6e724..f8f6445c5e 100644 --- a/locales/settings/zh-HK.json +++ b/locales/settings/zh-HK.json @@ -128,6 +128,11 @@ "integration.instapaper.password.label": "Instapaper 密碼", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "Instapaper 用戶名", + "integration.obsidian.enable.description": "顯示「儲存至 Obsidian」按鈕(如果可用)", + "integration.obsidian.enable.label": "啟用", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "你的 Obsidian 儲存庫的路徑", + "integration.obsidian.vaultPath.label": "Obsidian 儲存庫路徑", "integration.omnivore.enable.description": "顯示\"保存到 Omnivore\"按钮(如果可用)。", "integration.omnivore.enable.label": "啟用", "integration.omnivore.endpoint.description": "Omnivore 官方端口", diff --git a/locales/settings/zh-TW.json b/locales/settings/zh-TW.json index 2a37219d1b..a2e965b163 100644 --- a/locales/settings/zh-TW.json +++ b/locales/settings/zh-TW.json @@ -125,11 +125,16 @@ "integration.instapaper.password.label": "密碼", "integration.instapaper.title": "Instapaper", "integration.instapaper.username.label": "Instapaper 使用者", + "integration.obsidian.enable.description": "顯示「儲存到 Obsidian」按鈕(如果可用)", + "integration.obsidian.enable.label": "啟用", + "integration.obsidian.title": "Obsidian", + "integration.obsidian.vaultPath.description": "您的 Obsidian 儲存庫的路徑", + "integration.obsidian.vaultPath.label": "Obsidian 儲存庫路徑", "integration.readwise.enable.description": "顯示「儲存到 Readwise」按钮(如果可用)。", "integration.readwise.enable.label": "啟用", "integration.readwise.title": "Readwise", "integration.readwise.token.description": "您可以在這裡取得", - "integration.readwise.token.label": "Readwise 存取令牌", + "integration.readwise.token.label": "Readwise 令牌", "integration.sidebar_title": "整合功能", "integration.tip": "提示:您的敏感資料儲存於本機,不會上傳到伺服器。", "integration.title": "整合功能", diff --git a/packages/shared/src/interface/settings.ts b/packages/shared/src/interface/settings.ts index 397cc831c0..a6316103f2 100644 --- a/packages/shared/src/interface/settings.ts +++ b/packages/shared/src/interface/settings.ts @@ -56,4 +56,8 @@ export interface IntegrationSettings { enableOmnivore: boolean omnivoreEndpoint: string omnivoreToken: string + + // obsidian + enableObsidian: boolean + obsidianVaultPath: string }