From d30e356c1596687359389a8b542bc5c4344d48f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Sat, 18 May 2024 12:29:30 +0800 Subject: [PATCH] auto --- LunaTranslator/LunaTranslator/gui/showword.py | 9 ++++++++- LunaTranslator/files/defaultconfig/config.json | 3 ++- LunaTranslator/files/lang/ar.json | 3 ++- LunaTranslator/files/lang/cht.json | 3 ++- LunaTranslator/files/lang/en.json | 3 ++- LunaTranslator/files/lang/es.json | 3 ++- LunaTranslator/files/lang/fr.json | 3 ++- LunaTranslator/files/lang/it.json | 3 ++- LunaTranslator/files/lang/ja.json | 3 ++- LunaTranslator/files/lang/ko.json | 3 ++- LunaTranslator/files/lang/pl.json | 3 ++- LunaTranslator/files/lang/ru.json | 3 ++- LunaTranslator/files/lang/th.json | 3 ++- LunaTranslator/files/lang/tr.json | 3 ++- LunaTranslator/files/lang/uk.json | 3 ++- LunaTranslator/files/lang/vi.json | 3 ++- LunaTranslator/files/lang/zh.json | 3 ++- 17 files changed, 40 insertions(+), 17 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/showword.py b/LunaTranslator/LunaTranslator/gui/showword.py index b62e955d..afe4453c 100644 --- a/LunaTranslator/LunaTranslator/gui/showword.py +++ b/LunaTranslator/LunaTranslator/gui/showword.py @@ -354,6 +354,11 @@ class AnkiWindow(QWidget): getsimpleswitch(globalconfig["ankiconnect"], "ocrcroped"), ) + layout.addRow( + _TR("自动TTS"), + getsimpleswitch(globalconfig["ankiconnect"], "autoruntts"), + ) + layout.addWidget(QLabel()) layout.addRow(_TR("录音"), QLabel()) lb = QLabel() @@ -767,7 +772,9 @@ class searchwordW(closeashidewindow): self.ankiwindow.example.setPlainText(gobject.baseobject.currenttext) self.search(sentence) - + if globalconfig['ankiconnect']['autoruntts']: + self.ankiwindow.langdu() + self.ankiwindow.langdu2() def search(self, sentence): if sentence == "": return diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index 239583cc..7a7952b1 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -183,7 +183,8 @@ "ModelName3": "lunamodel3", "allowDuplicate": true, "autoUpdateModel": true, - "ocrcroped": false + "ocrcroped": false, + "autoruntts": false }, "ankiwindow": [ 100, diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index b804409d..696a670f 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -790,5 +790,6 @@ "优先级": "الأولوية", "编码": "ترميز", "安装录音驱动": "تثبيت برنامج تشغيل التسجيل", - "录音": "تسجيل صوتي" + "录音": "تسجيل صوتي", + "自动TTS": "التلقائي تحويل النص إلى كلام" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index 67fa7bc6..06a8be5a 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -790,5 +790,6 @@ "优先级": "優先順序", "编码": "編碼", "安装录音驱动": "安裝錄音驅動", - "录音": "錄音" + "录音": "錄音", + "自动TTS": "自動TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index c2bb2a69..a4a6169d 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -790,5 +790,6 @@ "优先级": "priority", "编码": "coding", "安装录音驱动": "Install recording driver", - "录音": "tape" + "录音": "tape", + "自动TTS": "Automatic TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index be90085c..10cd9327 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -790,5 +790,6 @@ "优先级": "Prioridad", "编码": "Codificación", "安装录音驱动": "Instalación de la unidad de grabación", - "录音": "Grabación" + "录音": "Grabación", + "自动TTS": "TTS automático" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index b10f6d59..16ecb817 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -790,5 +790,6 @@ "优先级": "Priorité", "编码": "Codage", "安装录音驱动": "Installer le driver d'enregistrement", - "录音": "Enregistrement sonore" + "录音": "Enregistrement sonore", + "自动TTS": "Tts automatique" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index dd641424..972312d4 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -790,5 +790,6 @@ "优先级": "priorità", "编码": "codifica", "安装录音驱动": "Installa il driver di registrazione", - "录音": "nastro" + "录音": "nastro", + "自动TTS": "TTS automatico" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index 036b5589..aa3fd249 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -790,5 +790,6 @@ "优先级": "優先度", "编码": "エンコード", "安装录音驱动": "録音ドライブのインストール", - "录音": "レコーディング" + "录音": "レコーディング", + "自动TTS": "自動TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index f88aab30..a04bb9ce 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -790,5 +790,6 @@ "优先级": "우선 순위", "编码": "인코딩", "安装录音驱动": "녹음 드라이브 설치", - "录音": "녹음" + "录音": "녹음", + "自动TTS": "자동 TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index 4ee285fc..cbb9e77b 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -790,5 +790,6 @@ "优先级": "priorytet", "编码": "kodowanie", "安装录音驱动": "Zainstaluj sterownik nagrywania", - "录音": "taśma" + "录音": "taśma", + "自动TTS": "Automatyczny TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index f3f72e6d..d3342324 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -790,5 +790,6 @@ "优先级": "Приоритеты", "编码": "Код", "安装录音驱动": "Установка привода звукозаписи", - "录音": "Запись" + "录音": "Запись", + "自动TTS": "Автоматический TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index e9359cd0..9a562130 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -790,5 +790,6 @@ "优先级": "ลำดับความสำคัญ", "编码": "การเข้ารหัส", "安装录音驱动": "ติดตั้งไดรฟ์บันทึก", - "录音": "การบันทึกเสียง" + "录音": "การบันทึกเสียง", + "自动TTS": "TTS อัตโนมัติ" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index fe755e49..ba52cd9b 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -790,5 +790,6 @@ "优先级": "Prioritet", "编码": "coding", "安装录音驱动": "Kayıt sürücüsünü kur", - "录音": "kaset" + "录音": "kaset", + "自动TTS": "Otomatik TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index d92e6e39..853c6922 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -790,5 +790,6 @@ "优先级": "пріоритет", "编码": "кодування", "安装录音驱动": "Встановити драйвер запису", - "录音": "стрічку" + "录音": "стрічку", + "自动TTS": "Автоматичний TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index 7bdc35ba..82609699 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -790,5 +790,6 @@ "优先级": "Ưu tiên", "编码": "Mã hóa", "安装录音驱动": "Cài đặt Recording Drive", - "录音": "Ghi âm" + "录音": "Ghi âm", + "自动TTS": "Tự động TTS" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index 07bba8e1..8427550e 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -790,5 +790,6 @@ "优先级": "", "编码": "", "安装录音驱动": "", - "录音": "" + "录音": "", + "自动TTS": "" } \ No newline at end of file