From ad44ab1a1223a845d37b406045a1cc874b2dae2f Mon Sep 17 00:00:00 2001 From: Pleasurecruise <3196812536@qq.com> Date: Tue, 27 May 2025 23:36:23 +0800 Subject: [PATCH] feat: update translation settings to include bidirectional translation tips and remove deprecated options --- src/renderer/src/i18n/locales/en-us.json | 5 +-- src/renderer/src/i18n/locales/ja-jp.json | 5 +-- src/renderer/src/i18n/locales/ru-ru.json | 5 +-- src/renderer/src/i18n/locales/zh-cn.json | 5 +-- src/renderer/src/i18n/locales/zh-tw.json | 8 +--- .../src/pages/translate/TranslatePage.tsx | 42 ++++++++++--------- 6 files changed, 28 insertions(+), 42 deletions(-) diff --git a/src/renderer/src/i18n/locales/en-us.json b/src/renderer/src/i18n/locales/en-us.json index 911102a79b..c43d0ae0df 100644 --- a/src/renderer/src/i18n/locales/en-us.json +++ b/src/renderer/src/i18n/locales/en-us.json @@ -1784,10 +1784,6 @@ "input.placeholder": "Enter text to translate", "output.placeholder": "Translation", "processing": "Translation in progress...", - "scroll_sync.disable": "Disable synced scroll", - "scroll_sync.enable": "Enable synced scroll", - "bidirectional.disable": "Disable bidirectional translation", - "bidirectional.enable": "Enable bidirectional translation", "language.same": "Source and target languages are the same", "language.not_pair": "Source language is different from the set language", "settings": { @@ -1795,6 +1791,7 @@ "model": "Model Settings", "model_desc": "Model used for translation service", "bidirectional": "Bidirectional Translation Settings", + "bidirectional_tip": "When enabled, only bidirectional translation between source and target languages is supported", "scroll_sync": "Scroll Sync Settings" }, "title": "Translation", diff --git a/src/renderer/src/i18n/locales/ja-jp.json b/src/renderer/src/i18n/locales/ja-jp.json index 73b96739aa..d95e636251 100644 --- a/src/renderer/src/i18n/locales/ja-jp.json +++ b/src/renderer/src/i18n/locales/ja-jp.json @@ -1784,10 +1784,6 @@ "input.placeholder": "翻訳するテキストを入力", "output.placeholder": "翻訳", "processing": "翻訳中...", - "scroll_sync.disable": "關閉滾動同步", - "scroll_sync.enable": "開啟滾動同步", - "bidirectional.disable": "双方向翻訳を無効にする", - "bidirectional.enable": "双方向翻訳を有効にする", "language.same": "ソース言語と目標言語が同じです", "language.not_pair": "ソース言語が設定された言語と異なります", "settings": { @@ -1795,6 +1791,7 @@ "model": "モデル設定", "model_desc": "翻訳サービスで使用されるモデル", "bidirectional": "双方向翻訳設定", + "bidirectional_tip": "有効にすると、ソース言語と目標言語間の双方向翻訳のみがサポートされます", "scroll_sync": "スクロール同期設定" }, "title": "翻訳", diff --git a/src/renderer/src/i18n/locales/ru-ru.json b/src/renderer/src/i18n/locales/ru-ru.json index 4b29123b0e..40540e5343 100644 --- a/src/renderer/src/i18n/locales/ru-ru.json +++ b/src/renderer/src/i18n/locales/ru-ru.json @@ -1784,10 +1784,6 @@ "input.placeholder": "Введите текст для перевода", "output.placeholder": "Перевод", "processing": "Перевод в процессе...", - "scroll_sync.disable": "Отключить синхронизацию прокрутки", - "scroll_sync.enable": "Включить синхронизацию прокрутки", - "bidirectional.disable": "Отключить двунаправленный перевод", - "bidirectional.enable": "Включить двунаправленный перевод", "language.same": "Исходный и целевой языки совпадают", "language.not_pair": "Исходный язык отличается от настроенного", "settings": { @@ -1795,6 +1791,7 @@ "model": "Настройки модели", "model_desc": "Модель, используемая для службы перевода", "bidirectional": "Настройки двунаправленного перевода", + "directional_tip": "После включения поддерживается только двунаправленный перевод между исходным и целевым языками", "scroll_sync": "Настройки синхронизации прокрутки" }, "title": "Перевод", diff --git a/src/renderer/src/i18n/locales/zh-cn.json b/src/renderer/src/i18n/locales/zh-cn.json index 3364eb5e08..8577377da7 100644 --- a/src/renderer/src/i18n/locales/zh-cn.json +++ b/src/renderer/src/i18n/locales/zh-cn.json @@ -1787,10 +1787,6 @@ "input.placeholder": "输入文本进行翻译", "output.placeholder": "翻译", "processing": "翻译中...", - "scroll_sync.disable": "关闭滚动同步", - "scroll_sync.enable": "开启滚动同步", - "bidirectional.disable": "关闭双向翻译", - "bidirectional.enable": "开启双向翻译", "language.same": "源语言和目标语言相同", "language.not_pair": "源语言与设置的语言不同", "settings": { @@ -1798,6 +1794,7 @@ "model": "模型设置", "model_desc": "翻译服务使用的模型", "bidirectional": "双向翻译设置", + "bidirectional_tip": "开启后,仅支持在源语言和目标语言之间进行双向翻译", "scroll_sync": "滚动同步设置" }, "title": "翻译", diff --git a/src/renderer/src/i18n/locales/zh-tw.json b/src/renderer/src/i18n/locales/zh-tw.json index 0563b68e97..b822a4893a 100644 --- a/src/renderer/src/i18n/locales/zh-tw.json +++ b/src/renderer/src/i18n/locales/zh-tw.json @@ -598,12 +598,11 @@ "citations": "引用內容", "copied": "已複製!", "copy.failed": "複製失敗", - "copy.success": "已複製!", + "copy.success": "複製成功", "delete.confirm.title": "刪除確認", "delete.confirm.content": "確認刪除選中的 {{count}} 條訊息嗎?", "delete.failed": "刪除失敗", "delete.success": "刪除成功", - "copy.success": "複製成功", "empty_url": "無法下載圖片,可能是提示詞包含敏感內容或違禁詞彙", "error.chunk_overlap_too_large": "分段重疊不能大於分段大小", "error.dimension_too_large": "內容尺寸過大", @@ -1785,10 +1784,6 @@ "input.placeholder": "輸入文字進行翻譯", "output.placeholder": "翻譯", "processing": "翻譯中...", - "scroll_sync.disable": "關閉滾動同步", - "scroll_sync.enable": "開啟滾動同步", - "bidirectional.disable": "關閉雙向翻譯", - "bidirectional.enable": "開啟雙向翻譯", "language.same": "源語言和目標語言相同", "language.not_pair": "源語言與設定的語言不同", "settings": { @@ -1796,6 +1791,7 @@ "model": "模型設定", "model_desc": "翻譯服務使用的模型", "bidirectional": "雙向翻譯設定", + "bidirectional_tip": "開啟後,僅支援在源語言和目標語言之間進行雙向翻譯", "scroll_sync": "滾動同步設定" }, "title": "翻譯", diff --git a/src/renderer/src/pages/translate/TranslatePage.tsx b/src/renderer/src/pages/translate/TranslatePage.tsx index 80cc30854e..656c73b5bd 100644 --- a/src/renderer/src/pages/translate/TranslatePage.tsx +++ b/src/renderer/src/pages/translate/TranslatePage.tsx @@ -19,12 +19,12 @@ import { getTargetLanguageForBidirectional, isLanguageInPair } from '@renderer/utils/translate' -import { Button, Divider, Empty, Flex, Modal, Popconfirm, Select, Space, Switch, Tooltip } from 'antd' +import { Button, Empty, Flex, Modal, Popconfirm, Select, Space, Switch, Tooltip } from 'antd' import TextArea, { TextAreaRef } from 'antd/es/input/TextArea' import dayjs from 'dayjs' import { useLiveQuery } from 'dexie-react-hooks' import { find, isEmpty, sortBy } from 'lodash' -import { Settings2, TriangleAlert } from 'lucide-react' +import { HelpCircle, Settings2, TriangleAlert } from 'lucide-react' import { FC, useEffect, useMemo, useRef, useState } from 'react' import { useTranslation } from 'react-i18next' import styled from 'styled-components' @@ -95,6 +95,7 @@ const TranslateSettings: FC<{ title={