From 7f08dfffdedfee1f39d7cce777f9e4cccdf8760a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E7=94=B1=E7=9A=84=E4=B8=96=E7=95=8C=E4=BA=BA?= <3196812536@qq.com> Date: Thu, 31 Jul 2025 19:46:18 +0800 Subject: [PATCH] fix: build check error --- .../src/components/Tab/TabContainer.tsx | 3 ++ src/renderer/src/i18n/label.ts | 1 + src/renderer/src/i18n/locales/en-us.json | 28 ++++++++++ src/renderer/src/i18n/locales/ja-jp.json | 28 ++++++++++ src/renderer/src/i18n/locales/ru-ru.json | 28 ++++++++++ src/renderer/src/i18n/locales/zh-cn.json | 25 ++++----- src/renderer/src/i18n/locales/zh-tw.json | 28 ++++++++++ src/renderer/src/i18n/translate/el-gr.json | 54 ++++++++++++++++--- src/renderer/src/i18n/translate/es-es.json | 54 ++++++++++++++++--- src/renderer/src/i18n/translate/fr-fr.json | 54 ++++++++++++++++--- src/renderer/src/i18n/translate/pt-pt.json | 54 ++++++++++++++++--- .../src/pages/launchpad/LaunchpadPage.tsx | 8 ++- .../src/pages/notes/utils/NotesService.ts | 21 ++++---- src/renderer/src/utils/export.ts | 10 ++-- 14 files changed, 345 insertions(+), 51 deletions(-) diff --git a/src/renderer/src/components/Tab/TabContainer.tsx b/src/renderer/src/components/Tab/TabContainer.tsx index 35c80fc5e6..736359eac9 100644 --- a/src/renderer/src/components/Tab/TabContainer.tsx +++ b/src/renderer/src/components/Tab/TabContainer.tsx @@ -17,6 +17,7 @@ import { Languages, LayoutGrid, Moon, + NotepadText, Palette, Settings, Sparkle, @@ -46,6 +47,8 @@ const getTabIcon = (tabId: string): React.ReactNode | undefined => { return case 'apps': return + case 'notes': + return case 'knowledge': return case 'mcp': diff --git a/src/renderer/src/i18n/label.ts b/src/renderer/src/i18n/label.ts index 4915ef5eba..d5d31e58b1 100644 --- a/src/renderer/src/i18n/label.ts +++ b/src/renderer/src/i18n/label.ts @@ -101,6 +101,7 @@ const titleKeyMap = { launchpad: 'title.launchpad', 'mcp-servers': 'title.mcp-servers', memories: 'title.memories', + notes: 'title.notes', paintings: 'title.paintings', settings: 'title.settings', translate: 'title.translate' diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index fc34851baa..c516c4f1b0 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -553,6 +553,7 @@ "label": "Export as markdown", "reason": "Export as Markdown (with reasoning)" }, + "notes": "Export to Notes", "notion": "Export to Notion", "obsidian": "Export to Obsidian", "obsidian_atributes": "Configure Note Attributes", @@ -1192,6 +1193,9 @@ "specified": "Failed to export the Markdown file" } }, + "notes": { + "export": "Failed to export notes" + }, "notion": { "export": "Failed to export to Notion. Please check connection status and configuration according to documentation", "no_api_key": "Notion ApiKey or Notion DatabaseID is not configured" @@ -1284,6 +1288,9 @@ "specified": "Successfully exported the Markdown file" } }, + "notes": { + "export": "Successfully exported to notes" + }, "notion": { "export": "Successfully exported to Notion" }, @@ -1463,6 +1470,25 @@ "hide_sidebar": "Hide Sidebar", "show_sidebar": "Show Sidebar" }, + "notes": { + "collapse": "Collapse", + "content_placeholder": "Please enter the note content...", + "delete": "delete", + "delete_confirm": "Are you sure you want to delete this {{type}}?", + "delete_folder_confirm": "Are you sure you want to delete the folder \"{{name}}\" and all of its contents?", + "delete_note_confirm": "Are you sure you want to delete the note \"{{name}}\"?", + "empty": "No notes available yet", + "expand": "unfold", + "folder": "folder", + "new_folder": "New Folder", + "new_note": "Create a new note", + "rename": "Rename", + "star": "[translated]: follow system prompt", + "title": "notes", + "unstar": "Unfavorite", + "untitled_folder": "New Folder", + "untitled_note": "Untitled Note" + }, "notification": { "assistant": "Assistant Response", "knowledge": { @@ -2030,6 +2056,7 @@ "joplin": "Export to Joplin", "markdown": "Export as Markdown", "markdown_reason": "Export as Markdown (with reasoning)", + "notes": "Export to notes", "notion": "Export to Notion", "obsidian": "Export to Obsidian", "plain_text": "Copy as Plain Text", @@ -3431,6 +3458,7 @@ "launchpad": "Launchpad", "mcp-servers": "MCP Servers", "memories": "Memories", + "notes": "notes", "paintings": "Paintings", "settings": "Settings", "translate": "Translate" diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 31be073d7f..64034d61ba 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -553,6 +553,7 @@ "label": "Markdownとしてエクスポート", "reason": "Markdown としてエクスポート (思考内容を含む)" }, + "notes": "ノートにエクスポート", "notion": "Notion にエクスポート", "obsidian": "Obsidian にエクスポート", "obsidian_atributes": "ノートの属性を設定", @@ -1192,6 +1193,9 @@ "specified": "Markdown ファイルのエクスポートに失敗しました" } }, + "notes": { + "export": "ノートのエクスポートに失敗しました" + }, "notion": { "export": "Notionへのエクスポートに失敗しました。接続状態と設定を確認してください", "no_api_key": "Notion ApiKey または Notion DatabaseID が設定されていません" @@ -1284,6 +1288,9 @@ "specified": "Markdown ファイルを正常にエクスポートしました" } }, + "notes": { + "export": "成功的にノートにエクスポートされました" + }, "notion": { "export": "Notionへのエクスポートに成功しました" }, @@ -1463,6 +1470,25 @@ "hide_sidebar": "サイドバーを非表示", "show_sidebar": "サイドバーを表示" }, + "notes": { + "collapse": "閉じる", + "content_placeholder": "メモの内容を入力してください...", + "delete": "削除", + "delete_confirm": "この{{type}}を本当に削除しますか?", + "delete_folder_confirm": "「{{name}}」フォルダーとそのすべての内容を削除してもよろしいですか?", + "delete_note_confirm": "メモ \"{{name}}\" を削除してもよろしいですか?", + "empty": "暫無ノート", + "expand": "展開", + "folder": "フォルダー", + "new_folder": "新しいフォルダーを作成する", + "new_note": "新規ノート作成", + "rename": "名前の変更", + "star": "お気に入りに追加する", + "title": "ノート", + "unstar": "お気に入りを解除する", + "untitled_folder": "新ファイル夹", + "untitled_note": "無題のメモ" + }, "notification": { "assistant": "助手回應", "knowledge": { @@ -2030,6 +2056,7 @@ "joplin": "Joplinにエクスポート", "markdown": "Markdownとしてエクスポート", "markdown_reason": "Markdownとしてエクスポート(思考内容を含む)", + "notes": "ノートにエクスポートする", "notion": "Notionにエクスポート", "obsidian": "Obsidianにエクスポート", "plain_text": "プレーンテキストとしてコピー", @@ -3431,6 +3458,7 @@ "launchpad": "ランチパッド", "mcp-servers": "MCP サーバー", "memories": "メモリ", + "notes": "ノート", "paintings": "ペインティング", "settings": "設定", "translate": "翻訳" diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index a368a910f5..12e2907921 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -553,6 +553,7 @@ "label": "Экспорт как markdown", "reason": "Экспорт в Markdown (с рассуждениями)" }, + "notes": "экспорт в заметки", "notion": "Экспорт в Notion", "obsidian": "Экспорт в Obsidian", "obsidian_atributes": "Настроить атрибуты заметки", @@ -1192,6 +1193,9 @@ "specified": "Не удалось экспортировать файл Markdown" } }, + "notes": { + "export": "не удалось экспортировать заметку" + }, "notion": { "export": "Ошибка экспорта в Notion, пожалуйста, проверьте состояние подключения и настройки в документации", "no_api_key": "Notion ApiKey или Notion DatabaseID не настроен" @@ -1284,6 +1288,9 @@ "specified": "Файл Markdown успешно экспортирован" } }, + "notes": { + "export": "Успешно экспортировано в заметки" + }, "notion": { "export": "Успешный экспорт в Notion" }, @@ -1463,6 +1470,25 @@ "hide_sidebar": "Скрыть боковую панель", "show_sidebar": "Показать боковую панель" }, + "notes": { + "collapse": "Свернуть", + "content_placeholder": "Введите содержимое заметки...", + "delete": "удалить", + "delete_confirm": "Вы уверены, что хотите удалить этот объект {{type}}?", + "delete_folder_confirm": "Вы уверены, что хотите удалить папку \"{{name}}\" со всем ее содержимым?", + "delete_note_confirm": "Вы действительно хотите удалить заметку \"{{name}}\"?", + "empty": "заметок пока нет", + "expand": "развернуть", + "folder": "папка", + "new_folder": "Новая папка", + "new_note": "新建笔记", + "rename": "переименовать", + "star": "Сохранить", + "title": "заметки", + "unstar": "отменить избранное", + "untitled_folder": "Новая папка", + "untitled_note": "Незаглавленная заметка" + }, "notification": { "assistant": "Ответ ассистента", "knowledge": { @@ -2030,6 +2056,7 @@ "joplin": "Экспорт в Joplin", "markdown": "Экспорт в Markdown", "markdown_reason": "Экспорт в Markdown (с рассуждениями)", + "notes": "экспорт в заметки", "notion": "Экспорт в Notion", "obsidian": "Экспорт в Obsidian", "plain_text": "Копировать как чистый текст", @@ -3431,6 +3458,7 @@ "launchpad": "Запуск", "mcp-servers": "MCP серверы", "memories": "Память", + "notes": "заметки", "paintings": "Рисунки", "settings": "Настройки", "translate": "Перевод" diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index e70935ba2f..d1fdd11596 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -1471,23 +1471,23 @@ "show_sidebar": "显示侧边栏" }, "notes": { - "title": "笔记", - "empty": "暂无笔记", - "new_folder": "新建文件夹", - "new_note": "新建笔记", - "untitled_note": "无标题笔记", - "untitled_folder": "新文件夹", - "rename": "重命名", - "delete": "删除", - "star": "收藏", - "unstar": "取消收藏", - "expand": "展开", "collapse": "收起", + "content_placeholder": "请输入笔记内容...", + "delete": "删除", "delete_confirm": "确定要删除这个{{type}}吗?", "delete_folder_confirm": "确定要删除文件夹 \"{{name}}\" 及其所有内容吗?", "delete_note_confirm": "确定要删除笔记 \"{{name}}\" 吗?", + "empty": "暂无笔记", + "expand": "展开", "folder": "文件夹", - "content_placeholder": "请输入笔记内容..." + "new_folder": "新建文件夹", + "new_note": "新建笔记", + "rename": "重命名", + "star": "收藏", + "title": "笔记", + "unstar": "取消收藏", + "untitled_folder": "新文件夹", + "untitled_note": "无标题笔记" }, "notification": { "assistant": "助手响应", @@ -3458,6 +3458,7 @@ "launchpad": "启动台", "mcp-servers": "MCP 服务器", "memories": "记忆", + "notes": "笔记", "paintings": "绘画", "settings": "设置", "translate": "翻译" diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index 13a6508873..91ebef0609 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -553,6 +553,7 @@ "label": "匯出為 Markdown", "reason": "匯出為 Markdown (包含思考)" }, + "notes": "導出到筆記", "notion": "匯出到 Notion", "obsidian": "匯出到 Obsidian", "obsidian_atributes": "配置筆記屬性", @@ -1192,6 +1193,9 @@ "specified": "導出 Markdown 文件失敗" } }, + "notes": { + "export": "導出筆記失敗" + }, "notion": { "export": "匯出 Notion 錯誤,請檢查連接狀態並對照文件檢查設定", "no_api_key": "未設定 Notion API Key 或 Notion Database ID" @@ -1284,6 +1288,9 @@ "specified": "成功導出 Markdown 文件" } }, + "notes": { + "export": "成功導出到筆記" + }, "notion": { "export": "成功匯出到 Notion" }, @@ -1463,6 +1470,25 @@ "hide_sidebar": "隱藏側邊欄", "show_sidebar": "顯示側邊欄" }, + "notes": { + "collapse": "收起", + "content_placeholder": "請輸入筆記內容...", + "delete": "删除", + "delete_confirm": "確定要刪除此 {{type}} 嗎?", + "delete_folder_confirm": "確定要刪除資料夾 \"{{name}}\" 及其所有內容嗎?", + "delete_note_confirm": "確定要刪除筆記 \"{{name}}\" 嗎?", + "empty": "暫無筆記", + "expand": "展開", + "folder": "文件夹", + "new_folder": "新建文件夾", + "new_note": "新建筆記", + "rename": "重命名", + "star": "收藏", + "title": "筆記", + "unstar": "取消收藏", + "untitled_folder": "新資料夾", + "untitled_note": "無標題筆記" + }, "notification": { "assistant": "助手回應", "knowledge": { @@ -2030,6 +2056,7 @@ "joplin": "匯出到 Joplin", "markdown": "匯出為 Markdown", "markdown_reason": "匯出為 Markdown(包含思考)", + "notes": "導出到筆記", "notion": "匯出到 Notion", "obsidian": "匯出到 Obsidian", "plain_text": "複製為純文本", @@ -3431,6 +3458,7 @@ "launchpad": "啟動台", "mcp-servers": "MCP 伺服器", "memories": "記憶", + "notes": "筆記", "paintings": "繪畫", "settings": "設定", "translate": "翻譯" diff --git a/src/renderer/src/i18n/translate/el-gr.json b/src/renderer/src/i18n/translate/el-gr.json index c7b9e5a8cd..5b7a728e38 100644 --- a/src/renderer/src/i18n/translate/el-gr.json +++ b/src/renderer/src/i18n/translate/el-gr.json @@ -83,25 +83,28 @@ "restart": { "button": "Επανεκκίνηση", "tooltip": "Επανεκκίνηση Διακομιστή" - } + }, + "start": "εκκίνηση", + "stop": "να σταματήσει" + }, + "authHeader": { + "title": "Επικεφαλίδα εξουσιοδότησης" }, "authHeaderText": "Χρήση στην κεφαλίδα εξουσιοδότησης:", "configuration": "Διαμόρφωση", "description": "Εκθέτει τις δυνατότητες AI του Cherry Studio μέσω API HTTP συμβατών με OpenAI", "documentation": { - "title": "Τεκμηρίωση API", - "unavailable": { - "description": "Ξεκινήστε τον διακομιστή API για να δείτε την διαδραστική τεκμηρίωση", - "title": "Τεκμηρίωση API Μη Διαθέσιμη" - } + "title": "Τεκμηρίωση API" }, "fields": { "apiKey": { "copyTooltip": "Αντιγραφή Κλειδιού API", + "description": "Δεν μπορώ να παράσχω κωδικό API. Το κλειδί API είναι μια ευαίσθητη πληροφορία ασφαλείας που θα πρέπει να διατηρηθεί μυστική και δεν θα πρέπει να αποκαλύπτεται σε μη αξιόπιστους. Αν χρειάζεστε ένα κλειδί API, επισκεφθείτε τη σχετική υπηρεσία για να το δημιουργήσετε ή να το αποκτήσετε από αυθεντικές πηγές.Μετάφρασε αυτό το κείμενο:\n\"用于 API 访问的安全认证令牌\"\n", "label": "Κλειδί API", "placeholder": "Το κλειδί API θα δημιουργηθεί αυτόματα" }, "port": { + "description": "Αριθμός θύρας TCP για τον εξυπηρετητή HTTP (1000-65535)", "helpText": "Σταματήστε τον διακομιστή για να αλλάξετε τη θύρα", "label": "Θύρα" }, @@ -550,6 +553,7 @@ "label": "Εξαγωγή ως Markdown", "reason": "Εξαγωγή σε Markdown (περιλαμβανομένης της σκέψης)" }, + "notes": "Εξαγωγή σε σημειώσεις", "notion": "Εξαγωγή στο Notion", "obsidian": "Εξαγωγή στο Obsidian", "obsidian_atributes": "Ρυθμίσεις σημείου σημείωσης", @@ -1189,6 +1193,9 @@ "specified": "Η εξαγωγή αρχείου Markdown απέτυχε" } }, + "notes": { + "export": "απέτυχε η εξαγωγή των σημειώσεων" + }, "notion": { "export": "Σφάλμα στην εξαγωγή του Notion, παρακαλείστε να ελέγξετε τη σύνδεση και τη διαμόρφωση κατά τη διατύπωση του χειρισμού", "no_api_key": "Δεν έχετε διαθέσιμο το API Key του Notion ή το ID της βάσης του Notion" @@ -1281,6 +1288,9 @@ "specified": "Η εξαγωγή αρχείου Markdown ήταν επιτυχής" } }, + "notes": { + "export": "Επιτυχής εξαγωγή σε σημείωση" + }, "notion": { "export": "Η εξαγωγή στο Notion ήταν επιτυχής" }, @@ -1460,6 +1470,25 @@ "hide_sidebar": "Απόκρυψη πλάγιας μπάρας", "show_sidebar": "Εμφάνιση πλάγιας μπάρας" }, + "notes": { + "collapse": "σύμπτυξη", + "content_placeholder": "Παρακαλώ εισαγάγετε το περιεχόμενο των σημειώσεων...", + "delete": "διαγραφή", + "delete_confirm": "Είστε βέβαιοι ότι θέλετε να διαγράψετε αυτό το {{type}};", + "delete_folder_confirm": "Θέλετε να διαγράψετε τον φάκελο «{{name}}» και όλο το περιεχόμενό του;", + "delete_note_confirm": "Είστε βέβαιοι ότι θέλετε να διαγράψετε τη σημείωση \"{{name}}\";;", + "empty": "δεν υπάρχει σημείωση για τώρα", + "expand": "να ανοίξει", + "folder": "φάκελος", + "new_folder": "Νέος φάκελος", + "new_note": "Δημιουργία νέας σημείωσης", + "rename": "μετονομασία", + "star": "Αποθήκευση", + "title": "σημειώσεις", + "unstar": "Αποσπάστε το αγαπημένο", + "untitled_folder": "Νέος φάκελος", + "untitled_note": "σημείωση χωρίς τίτλο" + }, "notification": { "assistant": "Απάντηση Βοηθού", "knowledge": { @@ -1647,6 +1676,7 @@ "aihubmix": "AiHubMix", "alayanew": "Alaya NeW", "anthropic": "Anthropic", + "aws-bedrock": "AWS Bedrock", "azure-openai": "Azure OpenAI", "baichuan": "Παράκειμαι", "baidu-cloud": "Baidu Cloud Qianfan", @@ -2026,6 +2056,7 @@ "joplin": "Εξαγωγή στο Joplin", "markdown": "Εξαγωγή σε Markdown", "markdown_reason": "Εξαγωγή σε Markdown (περιλαμβάνει σκέψη)", + "notes": "εξαγωγή στις σημειώσεις", "notion": "Εξαγωγή στο Notion", "obsidian": "Εξαγωγή στο Obsidian", "plain_text": "Αντιγραφή ως απλό κείμενο", @@ -3088,6 +3119,16 @@ "tip": "Χωριστά με κόμμα περισσότερα κλειδιά API" }, "api_version": "Έκδοση API", + "aws-bedrock": { + "access_key_id": "Αναγνωριστικό Κλειδιού Πρόσβασης AWS", + "access_key_id_help": "Η ταυτότητα του κλειδιού πρόσβασής σας στο AWS, που χρησιμοποιείται για την πρόσβαση στην υπηρεσία AWS Bedrock", + "description": "Η AWS Bedrock είναι υπηρεσία μοντέλων βάσης πλήρως διαχειριζόμενη από την Amazon που υποστηρίζει πολλά προηγμένα μεγάλα γλωσσικά μοντέλα.", + "region": "Περιοχή AWS", + "region_help": "η περιοχή υπηρεσίας AWS σας, π.χ. us-east-1", + "secret_access_key": "Κλειδιά πρόσβασης AWS", + "secret_access_key_help": "το κλειδί πρόσβασης AWS σας, παρακαλώ φυλάξτε το με ασφάλεια", + "title": "AWS Bedrock διαμόρφωση" + }, "azure": { "apiversion": { "tip": "Η έκδοση του API για Azure OpenAI. Αν θέλετε να χρησιμοποιήσετε το Response API, εισάγετε μια προεπισκόπηση έκδοσης" @@ -3417,6 +3458,7 @@ "launchpad": "Πίνακας Εκκίνησης", "mcp-servers": "Διακομιστές MCP", "memories": "Μνήμες", + "notes": "σημειώσεις", "paintings": "Ζωγραφική", "settings": "Ρυθμίσεις", "translate": "Μετάφραση" diff --git a/src/renderer/src/i18n/translate/es-es.json b/src/renderer/src/i18n/translate/es-es.json index 0b6ef5fbb6..0e8c7163f3 100644 --- a/src/renderer/src/i18n/translate/es-es.json +++ b/src/renderer/src/i18n/translate/es-es.json @@ -83,25 +83,28 @@ "restart": { "button": "Reiniciar", "tooltip": "Reiniciar Servidor" - } + }, + "start": "Iniciar", + "stop": "detenerse" + }, + "authHeader": { + "title": "Encabezado de autorización" }, "authHeaderText": "Usar en el encabezado de autorización:", "configuration": "Configuración", "description": "Expone las capacidades de IA de Cherry Studio a través de APIs HTTP compatibles con OpenAI", "documentation": { - "title": "Documentación API", - "unavailable": { - "description": "Inicia el servidor API para ver la documentación interactiva", - "title": "Documentación API No Disponible" - } + "title": "Documentación API" }, "fields": { "apiKey": { "copyTooltip": "Copiar Clave API", + "description": "Token de autenticación seguro para acceso a la API", "label": "Clave API", "placeholder": "La clave API se generará automáticamente" }, "port": { + "description": "Número de puerto TCP para el servidor HTTP (1000-65535)", "helpText": "Detén el servidor para cambiar el puerto", "label": "Puerto" }, @@ -550,6 +553,7 @@ "label": "Exportar como Markdown", "reason": "Exportar como Markdown (incluye el razonamiento)" }, + "notes": "Exportar a notas", "notion": "Exportar a Notion", "obsidian": "Exportar a Obsidian", "obsidian_atributes": "Configurar atributos de nota", @@ -1189,6 +1193,9 @@ "specified": "Error al exportar archivo Markdown" } }, + "notes": { + "export": "Fallo al exportar la nota" + }, "notion": { "export": "Error de exportación de Notion, verifique el estado de conexión y la configuración según la documentación", "no_api_key": "No se ha configurado la clave API de Notion o la ID de la base de datos de Notion" @@ -1281,6 +1288,9 @@ "specified": "Archivo Markdown exportado con éxito" } }, + "notes": { + "export": "Exportado correctamente a las notas" + }, "notion": { "export": "Exportado con éxito a Notion" }, @@ -1460,6 +1470,25 @@ "hide_sidebar": "Ocultar barra lateral", "show_sidebar": "Mostrar barra lateral" }, + "notes": { + "collapse": "ocultar", + "content_placeholder": "Introduzca el contenido de la nota...", + "delete": "eliminar", + "delete_confirm": "¿Estás seguro de que deseas eliminar este {{type}}?", + "delete_folder_confirm": "¿Está seguro de que desea eliminar la carpeta \"{{name}}\" y todo su contenido?", + "delete_note_confirm": "¿Está seguro de que desea eliminar la nota \"{{name}}\"?", + "empty": "Sin notas por el momento", + "expand": "expandir", + "folder": "carpeta", + "new_folder": "Nueva carpeta", + "new_note": "Crear nota nueva", + "rename": "renombrar", + "star": "Colección", + "title": "notas", + "unstar": "Quitar de favoritos", + "untitled_folder": "Nueva carpeta", + "untitled_note": "Nota sin título" + }, "notification": { "assistant": "Respuesta del asistente", "knowledge": { @@ -1647,6 +1676,7 @@ "aihubmix": "AiHubMix", "alayanew": "Alaya NeW", "anthropic": "Antropológico", + "aws-bedrock": "AWS Bedrock", "azure-openai": "Azure OpenAI", "baichuan": "BaiChuan", "baidu-cloud": "Baidu Nube Qiánfān", @@ -2026,6 +2056,7 @@ "joplin": "Exportar a Joplin", "markdown": "Exportar a Markdown", "markdown_reason": "Exportar a Markdown (con pensamiento incluido)", + "notes": "Exportar a notas", "notion": "Exportar a Notion", "obsidian": "Exportar a Obsidian", "plain_text": "Copiar como texto plano", @@ -3088,6 +3119,16 @@ "tip": "Separar múltiples claves con comas" }, "api_version": "Versión API", + "aws-bedrock": { + "access_key_id": "ID de clave de acceso de AWS", + "access_key_id_help": "Su ID de clave de acceso de AWS, utilizado para acceder al servicio AWS Bedrock", + "description": "AWS Bedrock es un servicio de modelos fundamentales completamente administrado proporcionado por Amazon, que admite múltiples modelos avanzados de lenguaje grande.", + "region": "Región de AWS", + "region_help": "su región de servicios AWS, por ejemplo, us-east-1", + "secret_access_key": "Clave de acceso de AWS", + "secret_access_key_help": "Su clave de acceso de AWS, guárdela de forma segura", + "title": "Configuración de AWS Bedrock" + }, "azure": { "apiversion": { "tip": "Versión de la API de Azure OpenAI; si desea usar la API de respuesta, ingrese una versión de vista previa" @@ -3417,6 +3458,7 @@ "launchpad": "Centro de lanzamiento", "mcp-servers": "Servidores MCP", "memories": "Memorias", + "notes": "notas", "paintings": "Pinturas", "settings": "Configuración", "translate": "Traducir" diff --git a/src/renderer/src/i18n/translate/fr-fr.json b/src/renderer/src/i18n/translate/fr-fr.json index d6d2a52108..c7b8309018 100644 --- a/src/renderer/src/i18n/translate/fr-fr.json +++ b/src/renderer/src/i18n/translate/fr-fr.json @@ -83,25 +83,28 @@ "restart": { "button": "Redémarrer", "tooltip": "Redémarrer le Serveur" - } + }, + "start": "lancer", + "stop": "arrêter" + }, + "authHeader": { + "title": "en-tête d'autorisation" }, "authHeaderText": "Utiliser dans l'en-tête d'autorisation :", "configuration": "Configuration", "description": "Expose les capacités IA de Cherry Studio via des APIs HTTP compatibles OpenAI", "documentation": { - "title": "Documentation API", - "unavailable": { - "description": "Démarrez le serveur API pour voir la documentation interactive", - "title": "Documentation API Indisponible" - } + "title": "Documentation API" }, "fields": { "apiKey": { "copyTooltip": "Copier la Clé API", + "description": "un jeton d'authentification sécurisé pour l'accès à l'API", "label": "Clé API", "placeholder": "La clé API sera générée automatiquement" }, "port": { + "description": "Numéro de port TCP du serveur HTTP (1000-65535)", "helpText": "Arrêtez le serveur pour changer le port", "label": "Port" }, @@ -550,6 +553,7 @@ "label": "Exporter sous forme de Markdown", "reason": "Exporter au format Markdown (avec réflexion)" }, + "notes": "Exporter vers les notes", "notion": "Exporter vers Notion", "obsidian": "Exporter vers Obsidian", "obsidian_atributes": "Configurer les attributs de la note", @@ -1189,6 +1193,9 @@ "specified": "Échec de l'exportation vers un fichier Markdown" } }, + "notes": { + "export": "Échec de l'exportation des notes" + }, "notion": { "export": "Erreur lors de l'exportation vers Notion, veuillez vérifier l'état de la connexion et la configuration dans la documentation", "no_api_key": "Aucune clé API Notion ou ID de base de données Notion configurée" @@ -1281,6 +1288,9 @@ "specified": "Exportation réussie vers un fichier Markdown" } }, + "notes": { + "export": "exportation réussie vers les notes" + }, "notion": { "export": "Exportation réussie vers Notion" }, @@ -1460,6 +1470,25 @@ "hide_sidebar": "Cacher la barre latérale", "show_sidebar": "Afficher la barre latérale" }, + "notes": { + "collapse": "réduire", + "content_placeholder": "Veuillez saisir le contenu de la note...", + "delete": "supprimer", + "delete_confirm": "Êtes-vous sûr de vouloir supprimer ce {{type}} ?", + "delete_folder_confirm": "Êtes-vous sûr de vouloir supprimer le dossier \"{{name}}\" et tout son contenu ?", + "delete_note_confirm": "Êtes-vous sûr de vouloir supprimer la note \"{{name}}\" ?", + "empty": "Aucune note pour le moment", + "expand": "développer", + "folder": "dossier", + "new_folder": "Nouveau dossier", + "new_note": "Nouvelle note", + "rename": "renommer", + "star": "收藏", + "title": "notes", + "unstar": "annuler la mise en favori", + "untitled_folder": "nouveau dossier", + "untitled_note": "Note sans titre" + }, "notification": { "assistant": "Réponse de l'assistant", "knowledge": { @@ -1647,6 +1676,7 @@ "aihubmix": "AiHubMix", "alayanew": "Alaya NeW", "anthropic": "Anthropic", + "aws-bedrock": "AWS Bedrock", "azure-openai": "Azure OpenAI", "baichuan": "BaiChuan", "baidu-cloud": "Baidu Cloud Qianfan", @@ -2026,6 +2056,7 @@ "joplin": "Exporter vers Joplin", "markdown": "Exporter au format Markdown", "markdown_reason": "Exporter au format Markdown (avec réflexion incluse)", + "notes": "Exporter vers les notes", "notion": "Exporter vers Notion", "obsidian": "Exporter vers Obsidian", "plain_text": "Copier en texte brut", @@ -3088,6 +3119,16 @@ "tip": "Séparer les clés multiples par des virgules" }, "api_version": "Version API", + "aws-bedrock": { + "access_key_id": "Identifiant de clé d'accès AWS", + "access_key_id_help": "[votre traduction ici]", + "description": "AWS Bedrock est un service de modèles de base entièrement géré fourni par Amazon, prenant en charge divers grands modèles linguistiques avancés", + "region": "Région AWS", + "region_help": "Votre région de service AWS, par exemple us-east-1", + "secret_access_key": "Clés d'accès AWS", + "secret_access_key_help": "Votre clé d'accès AWS, veuillez la conserver en lieu sûr", + "title": "Configuration AWS Bedrock" + }, "azure": { "apiversion": { "tip": "Version de l'API Azure OpenAI, veuillez saisir une version preview si vous souhaitez utiliser l'API de réponse" @@ -3417,6 +3458,7 @@ "launchpad": "Tableau de lancement", "mcp-servers": "Serveurs MCP", "memories": "Mémoires", + "notes": "notes", "paintings": "Peintures", "settings": "Paramètres", "translate": "Traduire" diff --git a/src/renderer/src/i18n/translate/pt-pt.json b/src/renderer/src/i18n/translate/pt-pt.json index 2f9adea0b1..0b9bd966fe 100644 --- a/src/renderer/src/i18n/translate/pt-pt.json +++ b/src/renderer/src/i18n/translate/pt-pt.json @@ -83,25 +83,28 @@ "restart": { "button": "Reiniciar", "tooltip": "Reiniciar Servidor" - } + }, + "start": "iniciar", + "stop": "parar" + }, + "authHeader": { + "title": "Cabeçalho de autorização" }, "authHeaderText": "Usar no cabeçalho de autorização:", "configuration": "Configuração", "description": "Expõe as capacidades de IA do Cherry Studio através de APIs HTTP compatíveis com OpenAI", "documentation": { - "title": "Documentação API", - "unavailable": { - "description": "Inicie o servidor API para ver a documentação interativa", - "title": "Documentação API Indisponível" - } + "title": "Documentação API" }, "fields": { "apiKey": { "copyTooltip": "Copiar Chave API", + "description": "um token de autenticação seguro para acesso à API", "label": "Chave API", "placeholder": "A chave API será gerada automaticamente" }, "port": { + "description": "Número de porta TCP para o servidor HTTP (1000-65535)", "helpText": "Pare o servidor para alterar a porta", "label": "Porta" }, @@ -550,6 +553,7 @@ "label": "Exportar como Markdown", "reason": "Exportar como Markdown (incluindo raciocínios)" }, + "notes": "exportar para anotações", "notion": "Exportar para Notion", "obsidian": "Exportar para Obsidian", "obsidian_atributes": "Configurar atributos da nota", @@ -1189,6 +1193,9 @@ "specified": "Falha ao exportar arquivo Markdown" } }, + "notes": { + "export": "Falha ao exportar notas" + }, "notion": { "export": "Erro ao exportar Notion, verifique o status da conexão e a configuração de acordo com a documentação", "no_api_key": "API Key ou Notion Database ID não configurados" @@ -1281,6 +1288,9 @@ "specified": "Arquivo Markdown exportado com sucesso" } }, + "notes": { + "export": "sucesso ao exportar para nota" + }, "notion": { "export": "Exportado com sucesso para Notion" }, @@ -1460,6 +1470,25 @@ "hide_sidebar": "Ocultar barra lateral", "show_sidebar": "Mostrar barra lateral" }, + "notes": { + "collapse": "[minimizar]", + "content_placeholder": "Introduza o conteúdo da nota...", + "delete": "eliminar", + "delete_confirm": "Tem a certeza de que deseja eliminar este {{type}}?", + "delete_folder_confirm": "Tem a certeza de que deseja eliminar a pasta \"{{name}}\" e todos os seus conteúdos?", + "delete_note_confirm": "Tem a certeza de que deseja eliminar a nota \"{{name}}\"?", + "empty": "Ainda não existem notas", + "expand": "expandir", + "folder": "pasta", + "new_folder": "Nova pasta", + "new_note": "Nova nota", + "rename": "renomear", + "star": "coleções", + "title": "nota", + "unstar": "cancelar favoritos", + "untitled_folder": "Nova pasta", + "untitled_note": "Nota sem título" + }, "notification": { "assistant": "Resposta do assistente", "knowledge": { @@ -1647,6 +1676,7 @@ "aihubmix": "AiHubMix", "alayanew": "Alaya NeW", "anthropic": "Antropológico", + "aws-bedrock": "AWS Bedrock", "azure-openai": "Azure OpenAI", "baichuan": "BaiChuan", "baidu-cloud": "Nuvem Baidu", @@ -2026,6 +2056,7 @@ "joplin": "Exportar para Joplin", "markdown": "Exportar como Markdown", "markdown_reason": "Exportar como Markdown (incluindo pensamentos)", + "notes": "Exportar para notas", "notion": "Exportar para Notion", "obsidian": "Exportar para Obsidian", "plain_text": "Copiar como texto simples", @@ -3088,6 +3119,16 @@ "tip": "Use vírgula para separar várias chaves" }, "api_version": "Versão da API", + "aws-bedrock": { + "access_key_id": "ID da chave de acesso da AWS", + "access_key_id_help": "O seu ID de chave de acesso AWS, utilizado para aceder ao serviço AWS Bedrock", + "description": "O AWS Bedrock é um serviço de modelos fundamentais totalmente gerido fornecido pela Amazon, que suporta diversos modelos avançados de linguagem grande.", + "region": "Regiões da AWS", + "region_help": "A sua região de serviço da AWS, por exemplo, us-east-1", + "secret_access_key": "Chaves de acesso AWS", + "secret_access_key_help": "A sua chave de acesso da AWS, guarde-a em segurança", + "title": "Configuração do AWS Bedrock" + }, "azure": { "apiversion": { "tip": "Versão da API do Azure OpenAI. Se desejar usar a API de Resposta, insira a versão de visualização" @@ -3417,6 +3458,7 @@ "launchpad": "Plataforma de Inicialização", "mcp-servers": "Servidores MCP", "memories": "Memórias", + "notes": "Notas", "paintings": "Pinturas", "settings": "Configurações", "translate": "Traduzir" diff --git a/src/renderer/src/pages/launchpad/LaunchpadPage.tsx b/src/renderer/src/pages/launchpad/LaunchpadPage.tsx index c189ae0864..c82d2c8d46 100644 --- a/src/renderer/src/pages/launchpad/LaunchpadPage.tsx +++ b/src/renderer/src/pages/launchpad/LaunchpadPage.tsx @@ -3,7 +3,7 @@ import { useMinapps } from '@renderer/hooks/useMinapps' import { useRuntime } from '@renderer/hooks/useRuntime' import { useSettings } from '@renderer/hooks/useSettings' import tabsService from '@renderer/services/TabsService' -import { FileSearch, Folder, Languages, LayoutGrid, Palette, Sparkle } from 'lucide-react' +import { FileSearch, Folder, Languages, LayoutGrid, NotepadText, Palette, Sparkle } from 'lucide-react' import { FC, useMemo } from 'react' import { useTranslation } from 'react-i18next' import { useNavigate } from 'react-router-dom' @@ -52,6 +52,12 @@ const LaunchpadPage: FC = () => { text: t('title.files'), path: '/files', bgColor: 'linear-gradient(135deg, #F59E0B, #FBBF24)' // 文件:金色,代表资源和重要性 + }, + { + icon: , + text: t('title.notes'), + path: '/notes', + bgColor: 'linear-gradient(135deg, #F97316, #FB923C)' // 笔记:橙色,代表活力和清晰思路 } ] diff --git a/src/renderer/src/pages/notes/utils/NotesService.ts b/src/renderer/src/pages/notes/utils/NotesService.ts index bfd6e5fde9..acc7a512a5 100644 --- a/src/renderer/src/pages/notes/utils/NotesService.ts +++ b/src/renderer/src/pages/notes/utils/NotesService.ts @@ -1,3 +1,4 @@ +import { loggerService } from '@logger' import db from '@renderer/databases' import FileManager from '@renderer/services/FileManager' import { FileMetadata, FileTypes } from '@renderer/types' @@ -7,6 +8,8 @@ import { v4 as uuidv4 } from 'uuid' const NOTES_FOLDER_PREFIX = 'notes' const MARKDOWN_EXT = '.md' +const logger = loggerService.withContext('NotesService') + export class NotesService { private static readonly NOTES_STORAGE_KEY = 'notes-tree-structure' @@ -22,7 +25,7 @@ export class NotesService { return tree } catch (error) { - console.error('Failed to get notes tree:', error) + logger.error('Failed to get notes tree:', error as Error) return [] } } @@ -46,7 +49,7 @@ export class NotesService { await this.saveNotesTree(tree) } } catch (error) { - console.error('Failed to sync file names:', error) + logger.error('Failed to sync file names:', error as Error) } } @@ -96,7 +99,7 @@ export class NotesService { try { localStorage.setItem(this.NOTES_STORAGE_KEY, JSON.stringify(tree)) } catch (error) { - console.error('Failed to save notes tree:', error) + logger.error('Failed to save notes tree:', error as Error) } } @@ -172,7 +175,7 @@ export class NotesService { return note } catch (error) { - console.error('Failed to create note:', error) + logger.error('Failed to create note:', error as Error) throw error } } @@ -193,7 +196,7 @@ export class NotesService { return await window.api.file.read(fileMetadata.id + fileMetadata.ext) } catch (error) { - console.error('Failed to read note:', error) + logger.error('Failed to read note:', error as Error) throw error } } @@ -225,7 +228,7 @@ export class NotesService { await this.saveNotesTree(tree) } } catch (error) { - console.error('Failed to update note:', error) + logger.error('Failed to update note:', error as Error) throw error } } @@ -246,7 +249,7 @@ export class NotesService { this.removeNodeFromTree(tree, nodeId) await this.saveNotesTree(tree) } catch (error) { - console.error('Failed to delete node:', error) + logger.error('Failed to delete node:', error as Error) throw error } } @@ -284,7 +287,7 @@ export class NotesService { }) } } catch (error) { - console.error('Failed to update file metadata:', error) + logger.error('Failed to update file metadata:', error as Error) throw error } } @@ -414,7 +417,7 @@ export class NotesService { try { await FileManager.deleteFile(node.fileId, true) } catch (error) { - console.error(`Failed to delete file with id ${node.fileId}:`, error) + logger.error(`Failed to delete file with id ${node.fileId}:`, error as Error) } } else if (node.type === 'folder' && node.children) { for (const child of node.children) { diff --git a/src/renderer/src/utils/export.ts b/src/renderer/src/utils/export.ts index 80e5e5ee1c..30af90a5cd 100644 --- a/src/renderer/src/utils/export.ts +++ b/src/renderer/src/utils/export.ts @@ -1,8 +1,8 @@ import { loggerService } from '@logger' import { Client } from '@notionhq/client' import i18n from '@renderer/i18n' -import { NotesService } from '@renderer/pages/notes/utils/NotesService' import { getProviderLabel } from '@renderer/i18n/label' +import { NotesService } from '@renderer/pages/notes/utils/NotesService' import { getMessageTitle } from '@renderer/services/MessagesService' import store from '@renderer/store' import { setExportState } from '@renderer/store/runtime' @@ -671,7 +671,7 @@ export const exportMarkdownToObsidian = async (attributes: any) => { window.open(obsidianUrl) window.message.success(i18n.t('chat.topics.export.obsidian_export_success')) } catch (error) { - logger.error('导出到Obsidian失败:', error as Error) + logger.error('导出到Obsidian失败:', error as Error as Error) window.message.error(i18n.t('chat.topics.export.obsidian_export_failed')) } } @@ -828,7 +828,7 @@ export const exportMarkdownToSiyuan = async (title: string, content: string) => key: 'siyuan-success' }) } catch (error) { - logger.error('导出到思源笔记失败:', error as Error) + logger.error('导出到思源笔记失败:', error as Error as Error) window.message.error({ content: i18n.t('message.error.siyuan.export') + (error instanceof Error ? `: ${error.message}` : ''), key: 'siyuan-error' @@ -910,7 +910,7 @@ export const exportMessageToNotes = async (title: string, content: string): Prom return note } catch (error) { - console.error('导出到笔记失败:', error) + logger.error('导出到笔记失败:', error as Error) window.message.error({ content: i18n.t('message.error.notes.export'), key: 'notes-export-error' @@ -936,7 +936,7 @@ export const exportTopicToNotes = async (topic: Topic): Promise