From 08793262452f8a91afbb862f59e36a64d50f468f 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: Thu, 15 Aug 2024 19:51:00 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/setting_about.py | 8 +------- LunaTranslator/LunaTranslator/myutils/utils.py | 11 +++++++++-- .../LunaTranslator/translator/basetranslator.py | 3 ++- LunaTranslator/files/defaultconfig/static_data.json | 6 +----- .../files/defaultconfig/translatorsetting.json | 2 +- LunaTranslator/files/lang/ar.json | 4 ++-- LunaTranslator/files/lang/cht.json | 4 ++-- LunaTranslator/files/lang/cs.json | 4 ++-- LunaTranslator/files/lang/de.json | 4 ++-- LunaTranslator/files/lang/en.json | 4 ++-- LunaTranslator/files/lang/es.json | 4 ++-- LunaTranslator/files/lang/fr.json | 4 ++-- LunaTranslator/files/lang/it.json | 4 ++-- LunaTranslator/files/lang/ja.json | 4 ++-- LunaTranslator/files/lang/ko.json | 4 ++-- LunaTranslator/files/lang/nl.json | 4 ++-- LunaTranslator/files/lang/pl.json | 4 ++-- LunaTranslator/files/lang/pt.json | 4 ++-- LunaTranslator/files/lang/ru.json | 4 ++-- LunaTranslator/files/lang/sv.json | 4 ++-- LunaTranslator/files/lang/th.json | 4 ++-- LunaTranslator/files/lang/tr.json | 4 ++-- LunaTranslator/files/lang/uk.json | 4 ++-- LunaTranslator/files/lang/vi.json | 4 ++-- LunaTranslator/files/lang/zh.json | 1 - plugins/CMakeLists.txt | 2 +- 26 files changed, 53 insertions(+), 56 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/setting_about.py b/LunaTranslator/LunaTranslator/gui/setting_about.py index aaf2b3a0..e20a0122 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_about.py +++ b/LunaTranslator/LunaTranslator/gui/setting_about.py @@ -230,13 +230,7 @@ def versionlabelmaybesettext(self, x): def solvelinkitems(grid, source): name = source["name"] link = source["link"] - if link[-8:] == "releases": - __ = False - elif link[-1] == "/": - __ = False - else: - __ = True - grid.append([((name), 1, ""), (makehtml(link, __), 2, "link")]) + grid.append([((name), 1, ""), (makehtml(link), 2, "link")]) def resourcegrid(self, l): diff --git a/LunaTranslator/LunaTranslator/myutils/utils.py b/LunaTranslator/LunaTranslator/myutils/utils.py index 50bf2247..741a09fb 100644 --- a/LunaTranslator/LunaTranslator/myutils/utils.py +++ b/LunaTranslator/LunaTranslator/myutils/utils.py @@ -499,9 +499,16 @@ def dynamiclink(text): ) -def makehtml(text, base=False, show=None): +def makehtml(text, show=None): + + if text[-8:] == "releases": + __ = False + elif text[-1] == "/": + __ = False + else: + __ = True text = dynamiclink(text) - if base: + if __: show = text.split("/")[-1] elif show: pass diff --git a/LunaTranslator/LunaTranslator/translator/basetranslator.py b/LunaTranslator/LunaTranslator/translator/basetranslator.py index 580a4ca8..cda94bc9 100644 --- a/LunaTranslator/LunaTranslator/translator/basetranslator.py +++ b/LunaTranslator/LunaTranslator/translator/basetranslator.py @@ -239,7 +239,8 @@ class basetrans(commonbase): if res: return res - if self.transtype == "offline": + if self.transtype == "offline" and not self.is_gpt_like: + # 避免离线gpt被大量翻译阻塞 res = self.translate(contentsolved) else: res = self.intervaledtranslate(contentsolved) diff --git a/LunaTranslator/files/defaultconfig/static_data.json b/LunaTranslator/files/defaultconfig/static_data.json index 35b04f60..deec83cd 100644 --- a/LunaTranslator/files/defaultconfig/static_data.json +++ b/LunaTranslator/files/defaultconfig/static_data.json @@ -846,11 +846,7 @@ }, { "name": "Sakura大模型", - "link": "https://github.com/SakuraLLM/Sakura-13B-Galgame" - }, - { - "name": "TGW懒人包", - "link": "https://pan.baidu.com/s/1fe7iiHIAtoXW80Twsrv8Nw?pwd=pato" + "link": "https://github.com/SakuraLLM/SakuraLLM" } ] }, diff --git a/LunaTranslator/files/defaultconfig/translatorsetting.json b/LunaTranslator/files/defaultconfig/translatorsetting.json index 34cd3610..3698464f 100644 --- a/LunaTranslator/files/defaultconfig/translatorsetting.json +++ b/LunaTranslator/files/defaultconfig/translatorsetting.json @@ -1133,7 +1133,7 @@ }, "prompt_version": { "rank": 1.1, - "name": "prompt version", + "name": "prompt格式(需要根据模型版本决定。使用v0.10pre1以支持gpt词典)", "type": "combo", "list": [ "v0.9", diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index 4b0881c1..a7c9096b 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -732,7 +732,6 @@ "语言包": "حزمة اللغة", "项目仓库": "مشروع مستودع", "整合包": "حزمة متكاملة", - "TGW懒人包": "TGW الكسول حقيبة", "论坛": "المنتديات", "请选择": "الرجاء اختيار", "安装成功": "تثبيت بنجاح", @@ -834,5 +833,6 @@ "官方网站": "الموقع الرسمي", "欢迎使用": "مرحبا بكم في استخدام", "显示注音": "عرض صوتي", - "辞书显示顺序": "ترتيب عرض القاموس" + "辞书显示顺序": "ترتيب عرض القاموس", + "背景窗口透明": "نافذة خلفية شفافة" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index 6277accf..11c8dd06 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -732,7 +732,6 @@ "语言包": "語言包", "项目仓库": "專案儲存庫", "整合包": "整合包", - "TGW懒人包": "TGW 懶人包", "论坛": "論壇", "请选择": "請選擇", "安装成功": "安裝成功", @@ -834,5 +833,6 @@ "官方网站": "官方網站", "欢迎使用": "歡迎使用", "显示注音": "顯示注音", - "辞书显示顺序": "辭書顯示順序" + "辞书显示顺序": "辭書顯示順序", + "背景窗口透明": "背景視窗透明" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cs.json b/LunaTranslator/files/lang/cs.json index 93ae790f..10b9c7b6 100644 --- a/LunaTranslator/files/lang/cs.json +++ b/LunaTranslator/files/lang/cs.json @@ -734,7 +734,6 @@ "翻译及OCR": "Překlady a OCR", "项目仓库": "Skladiště projektu", "整合包": "Integrační balíček", - "TGW懒人包": "TGW Lazy Bag", "论坛": "fórum", "请选择": "Prosím vyberte", "安装成功": "Instalace úspěšná", @@ -834,5 +833,6 @@ "官方网站": "Oficiální internetové stránky", "欢迎使用": "Vítejte v použití", "显示注音": "Zobrazit fonetickou zápis", - "辞书显示顺序": "Lexikografické pořadí zobrazení" + "辞书显示顺序": "Lexikografické pořadí zobrazení", + "背景窗口透明": "Okno pozadí transparentní" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/de.json b/LunaTranslator/files/lang/de.json index 2913a9b7..9100871b 100644 --- a/LunaTranslator/files/lang/de.json +++ b/LunaTranslator/files/lang/de.json @@ -734,7 +734,6 @@ "翻译及OCR": "Übersetzung und OCR", "项目仓库": "Projektlager", "整合包": "Integrationspaket", - "TGW懒人包": "TGW Lazy Bag", "论坛": "Forum", "请选择": "Bitte wählen", "安装成功": "Installation erfolgreich", @@ -834,5 +833,6 @@ "官方网站": "Offizielle Website", "欢迎使用": "Willkommen zur Nutzung", "显示注音": "Phonetische Notation anzeigen", - "辞书显示顺序": "Lexikographische Anzeigereihenfolge" + "辞书显示顺序": "Lexikographische Anzeigereihenfolge", + "背景窗口透明": "Hintergrundfenster transparent" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index 4fcc0587..7d6c2921 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -731,7 +731,6 @@ "语言包": "Language Pack", "项目仓库": "Project Repository", "整合包": "Integration Pack", - "TGW懒人包": "TGW Lazy Pack", "论坛": "Forum", "请选择": "Please Select", "安装成功": "Installation Successful", @@ -834,5 +833,6 @@ "官方网站": "Official website", "欢迎使用": "Welcome to use", "显示注音": "Display phonetic notation", - "辞书显示顺序": "Lexicographical display order" + "辞书显示顺序": "Lexicographical display order", + "背景窗口透明": "Background window transparent" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index 6b0da653..98011078 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -732,7 +732,6 @@ "语言包": "Paquete lingüístico", "项目仓库": "Almacén del proyecto", "整合包": "Paquete de integración", - "TGW懒人包": "Bolsa perezosa tgw", "论坛": "Foro", "请选择": "Por favor, elija", "安装成功": "Instalación exitosa", @@ -834,5 +833,6 @@ "官方网站": "Sitio web oficial", "欢迎使用": "Bienvenido a usar", "显示注音": "Muestra la nota de sonido", - "辞书显示顺序": "Orden de visualización del diccionario" + "辞书显示顺序": "Orden de visualización del diccionario", + "背景窗口透明": "La ventana de fondo es transparente" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index 98bbd7f0..de443dc0 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -732,7 +732,6 @@ "语言包": "Pack de langues", "项目仓库": "Entrepôt du projet", "整合包": "Paquet de consolidation", - "TGW懒人包": "Tgw sac pour paresseux", "论坛": "Le Forum", "请选择": "Veuillez sélectionner", "安装成功": "Installation réussie", @@ -834,5 +833,6 @@ "官方网站": "Site officiel", "欢迎使用": "Bienvenue à utiliser", "显示注音": "Afficher les notes", - "辞书显示顺序": "Ordre d'affichage des discours" + "辞书显示顺序": "Ordre d'affichage des discours", + "背景窗口透明": "Fenêtre de fond transparente" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index 0eeb46a5..354e8e41 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -732,7 +732,6 @@ "语言包": "Pacchetto linguistico", "项目仓库": "Magazzino del progetto", "整合包": "Pacchetto di integrazione", - "TGW懒人包": "TGW Lazy Bag", "论坛": "forum", "请选择": "Seleziona", "安装成功": "Installazione riuscita", @@ -834,5 +833,6 @@ "官方网站": "Sito ufficiale", "欢迎使用": "Benvenuti all'uso", "显示注音": "Mostra notazione fonetica", - "辞书显示顺序": "Ordine di visualizzazione lessicografico" + "辞书显示顺序": "Ordine di visualizzazione lessicografico", + "背景窗口透明": "Finestra di sfondo trasparente" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index 1052d545..8ce0d738 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -732,7 +732,6 @@ "语言包": "言語パック", "项目仓库": "プロジェクトウェアハウス", "整合包": "統合パッケージ", - "TGW懒人包": "TGW怠け者バッグ", "论坛": "フォーラム", "请选择": "選択してください", "安装成功": "インストールに成功しました", @@ -834,5 +833,6 @@ "官方网站": "公式サイト", "欢迎使用": "ようこそ", "显示注音": "ルビを表示", - "辞书显示顺序": "辞書の表示順序" + "辞书显示顺序": "辞書の表示順序", + "背景窗口透明": "背景ウィンドウの透過性" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index c28b60fe..daef2660 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -732,7 +732,6 @@ "语言包": "언어 팩", "项目仓库": "프로젝트 웨어하우스", "整合包": "패키지 통합", - "TGW懒人包": "TGW 게으름뱅이 가방", "论坛": "포럼", "请选择": "선택하십시오.", "安装成功": "설치 성공", @@ -834,5 +833,6 @@ "官方网站": "공식 사이트", "欢迎使用": "시작", "显示注音": "메모 표시", - "辞书显示顺序": "사서 표시 순서" + "辞书显示顺序": "사서 표시 순서", + "背景窗口透明": "배경 창 투명도" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/nl.json b/LunaTranslator/files/lang/nl.json index 2fc4628e..2e975c4d 100644 --- a/LunaTranslator/files/lang/nl.json +++ b/LunaTranslator/files/lang/nl.json @@ -734,7 +734,6 @@ "翻译及OCR": "Vertaling en OCR", "项目仓库": "Projectmagazijn", "整合包": "Integratiepakket", - "TGW懒人包": "TGW Lazy Bag", "论坛": "forum", "请选择": "Kies alsjeblieft", "安装成功": "Installatie succesvol", @@ -834,5 +833,6 @@ "官方网站": "Officiële website", "欢迎使用": "Welkom bij gebruik", "显示注音": "Toon fonetische notatie", - "辞书显示顺序": "Lexicografische weergavevolgorde" + "辞书显示顺序": "Lexicografische weergavevolgorde", + "背景窗口透明": "Achtergrondvenster transparant" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index dc00f618..2baba3a0 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -732,7 +732,6 @@ "语言包": "Pakiet językowy", "项目仓库": "Magazyn projektu", "整合包": "Pakiet integracyjny", - "TGW懒人包": "TGW Lazy Bag", "论坛": "forum", "请选择": "Proszę wybrać", "安装成功": "Instalacja pomyślna", @@ -834,5 +833,6 @@ "官方网站": "Oficjalna strona internetowa", "欢迎使用": "Witamy w użyciu", "显示注音": "Wyświetla notację fonetyczną", - "辞书显示顺序": "Kolejność wyświetlania leksygraficznego" + "辞书显示顺序": "Kolejność wyświetlania leksygraficznego", + "背景窗口透明": "Okno tła przejrzyste" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pt.json b/LunaTranslator/files/lang/pt.json index 78a9d296..bd4d957c 100644 --- a/LunaTranslator/files/lang/pt.json +++ b/LunaTranslator/files/lang/pt.json @@ -734,7 +734,6 @@ "翻译及OCR": "Tradução e OCR", "项目仓库": "Armazém do Projecto", "整合包": "Pacote de integração", - "TGW懒人包": "Saco Preguiçoso TGW", "论坛": "fórum", "请选择": "Por favor escolha", "安装成功": "Instalação bem sucedida", @@ -834,5 +833,6 @@ "官方网站": "Sítio Web oficial", "欢迎使用": "Bem- vindo ao uso", "显示注音": "Mostrar a notação fonética", - "辞书显示顺序": "Ordem de visualização lexicográfica" + "辞书显示顺序": "Ordem de visualização lexicográfica", + "背景窗口透明": "Janela de fundo transparente" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index 81b69192..2131f5da 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -732,7 +732,6 @@ "语言包": "Языковый пакет", "项目仓库": "Проектный склад", "整合包": "Пакет интеграции", - "TGW懒人包": "ТГВ сумка лентяй", "论坛": "Форум", "请选择": "Выберите", "安装成功": "Установка прошла успешно", @@ -834,5 +833,6 @@ "官方网站": "Официальный сайт", "欢迎使用": "Добро пожаловать в использование", "显示注音": "Показать звук", - "辞书显示顺序": "Словарь показывает порядок" + "辞书显示顺序": "Словарь показывает порядок", + "背景窗口透明": "Фоновое окно прозрачно" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/sv.json b/LunaTranslator/files/lang/sv.json index ab426737..c49f9e68 100644 --- a/LunaTranslator/files/lang/sv.json +++ b/LunaTranslator/files/lang/sv.json @@ -734,7 +734,6 @@ "翻译及OCR": "Översättning och OCR", "项目仓库": "Projektlager", "整合包": "Integrationspaket", - "TGW懒人包": "TGW Lazy Bag", "论坛": "forum", "请选择": "Välj", "安装成功": "Installation lyckad", @@ -834,5 +833,6 @@ "官方网站": "Officiell webbplats", "欢迎使用": "Välkommen att använda", "显示注音": "Visa fonetisk notation", - "辞书显示顺序": "Lexikografisk visningsordning" + "辞书显示顺序": "Lexikografisk visningsordning", + "背景窗口透明": "Bakgrundsfönster genomskinligt" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index e2bbce22..0f8ead33 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -732,7 +732,6 @@ "语言包": "แพคภาษา", "项目仓库": "คลังสินค้าโครงการ", "整合包": "แพคเกจรวม", - "TGW懒人包": "กระเป๋า TGW Lazy", "论坛": "ฟอรั่ม", "请选择": "กรุณาเลือก", "安装成功": "ติดตั้งสำเร็จ", @@ -834,5 +833,6 @@ "官方网站": "เว็บไซต์อย่างเป็นทางการ", "欢迎使用": "ยินดีต้อนรับสู่", "显示注音": "แสดงหมายเหตุ", - "辞书显示顺序": "ลำดับการแสดงสำนวน" + "辞书显示顺序": "ลำดับการแสดงสำนวน", + "背景窗口透明": "หน้าต่างพื้นหลังโปร่งใส" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index 51e6189c..aef7b2a1 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -732,7 +732,6 @@ "语言包": "Dil Paketi", "项目仓库": "Proje deposu", "整合包": "Integrasyon paketi", - "TGW懒人包": "TGW Lazy Bag", "论坛": "forum", "请选择": "Lütfen seçin", "安装成功": "Yükleme başarılı", @@ -834,5 +833,6 @@ "官方网站": "Resmi web sitesi", "欢迎使用": "Kullanmaya hoş geldiniz.", "显示注音": "Fonetik notasyonu göster", - "辞书显示顺序": "Lexicographical display order" + "辞书显示顺序": "Lexicographical display order", + "背景窗口透明": "Arkaplan penceresi transparent" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index 7e9f5204..778893c4 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -732,7 +732,6 @@ "语言包": "Пакет мов", "项目仓库": "Склад проекту", "整合包": "Пакет інтеграції", - "TGW懒人包": "TGW Lazy Bag", "论坛": "форум", "请选择": "Будь ласка, виберіть", "安装成功": "Встановлення успішно", @@ -834,5 +833,6 @@ "官方网站": "Офіційна веб-сайт", "欢迎使用": "Ласкаво просимо використовувати", "显示注音": "Показувати фонетичну нотацію", - "辞书显示顺序": "Лексикографічний порядок показу" + "辞书显示顺序": "Лексикографічний порядок показу", + "背景窗口透明": "Прозоре вікно тла" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index dd43c342..0b0cdbeb 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -732,7 +732,6 @@ "语言包": "Gói ngôn ngữ", "项目仓库": "Kho dự án", "整合包": "Gói tích hợp", - "TGW懒人包": "Túi xách lười TGW", "论坛": "Diễn đàn", "请选择": "Vui lòng chọn", "安装成功": "Cài đặt thành công", @@ -834,5 +833,6 @@ "官方网站": "Trang web chính thức", "欢迎使用": "Chào mừng đến với", "显示注音": "Hiện chú thích", - "辞书显示顺序": "Trình tự hiển thị từ điển" + "辞书显示顺序": "Trình tự hiển thị từ điển", + "背景窗口透明": "Trong suốt cửa sổ nền" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index e9690c99..e2028083 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -736,7 +736,6 @@ "翻译及OCR": "", "项目仓库": "", "整合包": "", - "TGW懒人包": "", "论坛": "", "请选择": "", "安装成功": "", diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 441fa685..719bddf6 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 26) -set(VERSION_PATCH 11) +set(VERSION_PATCH 12) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)