diff --git a/LunaTranslator/LunaTranslator/LunaTranslator.py b/LunaTranslator/LunaTranslator/LunaTranslator.py index d95cad40..cc872d42 100644 --- a/LunaTranslator/LunaTranslator/LunaTranslator.py +++ b/LunaTranslator/LunaTranslator/LunaTranslator.py @@ -1,5 +1,5 @@ import time, uuid -import os, threading, re, codecs, winreg +import os, threading, re, winreg from qtsymbols import * from traceback import print_exc from myutils.config import ( @@ -15,7 +15,6 @@ from ctypes import c_int, CFUNCTYPE, c_void_p from myutils.utils import ( minmaxmoveobservefunc, parsemayberegexreplace, - kanjitrans, find_or_create_uid, checkisusingwine, checkpostusing, @@ -34,7 +33,7 @@ from textsource.textsourcebase import basetext from textsource.filetrans import filetrans from gui.selecthook import hookselect from gui.translatorUI import TranslatorWindow -import zhconv, functools +import functools from gui.transhist import transhist from gui.edittext import edittext import importlib, qtawesome @@ -271,11 +270,16 @@ class MAINUI: text, is_auto_run=True, waitforresultcallback=None, + waitforresultcallbackengine=None, donttrans=False, ): with self.solvegottextlock: succ = self.textgetmethod_1( - text, is_auto_run, waitforresultcallback, donttrans + text, + is_auto_run, + waitforresultcallback, + waitforresultcallbackengine, + donttrans, ) if waitforresultcallback and not succ: waitforresultcallback("") @@ -285,6 +289,7 @@ class MAINUI: text, is_auto_run=True, waitforresultcallback=None, + waitforresultcallbackengine=None, donttrans=False, ): if not text: @@ -357,7 +362,6 @@ class MAINUI: text_solved, optimization_params = self.solvebeforetrans(text) - usefultranslators = list(self.translators.keys()) maybehaspremt = {} fix_rank = globalconfig["fix_translate_rank_rank"].copy() @@ -379,6 +383,14 @@ class MAINUI: if len(real_fix_rank) == 0: return _showrawfunction() + + if waitforresultcallbackengine: + if waitforresultcallbackengine in real_fix_rank: + real_fix_rank = [waitforresultcallbackengine] + else: + waitforresultcallbackengine = None + + usefultranslators = real_fix_rank.copy() if globalconfig["fix_translate_rank"] and (not waitforresultcallback): _showrawfunction = functools.partial( self._delaypreparefixrank, _showrawfunction, real_fix_rank @@ -536,16 +548,7 @@ class MAINUI: if len(self.currenttranslate): self.currenttranslate += "\n" self.currenttranslate += res - if globalconfig["embedded"]["as_fast_as_posible"] or ( - classname == globalconfig["embedded"]["translator_2"] - ): - safe_callback( - kanjitrans(zhconv.convert(res, "zh-tw")) - if globalconfig["embedded"]["trans_kanji"] - else res - ) - elif len(usefultranslators) == 0: - safe_callback("") + safe_callback(res) def __usewhich(self): diff --git a/LunaTranslator/LunaTranslator/gui/rangeselect.py b/LunaTranslator/LunaTranslator/gui/rangeselect.py index 6caa732a..1fd64875 100644 --- a/LunaTranslator/LunaTranslator/gui/rangeselect.py +++ b/LunaTranslator/LunaTranslator/gui/rangeselect.py @@ -3,6 +3,7 @@ import windows, winsharedutils from myutils.config import globalconfig from gui.resizeablemainwindow import Mainw from gui.dynalang import LAction +from traceback import print_exc class rangeadjust(Mainw): @@ -181,7 +182,6 @@ class rangeselect(QMainWindow): self.__start = None self.__end = None self.startauto = False - self.clickrelease = False self.rectlabel.resize(0, 0) self.rectlabel.setStyleSheet( " border:%spx solid %s; background-color: rgba(0,0,0, 0)" @@ -191,18 +191,6 @@ class rangeselect(QMainWindow): "background-color: rgba(255,255,255, %s)" % globalconfig["ocrselectalpha"] ) - def immediateend(self): - try: - - self.close() - - if not self.once: - return - self.once = False - self.callback(self.getRange()) - except: - pass - def paintEvent(self, event): if self.is_drawing: @@ -227,9 +215,8 @@ class rangeselect(QMainWindow): def mousePressEvent(self, event): if event.button() == Qt.MouseButton.LeftButton: - if self.clickrelease: - self.clickrelease = False - self.mouseReleaseEvent(event) + if self.startauto: + self.callbackfunction(event) else: self.end_point = self.start_point = event.pos() self.is_drawing = True @@ -241,14 +228,14 @@ class rangeselect(QMainWindow): self.is_drawing = True self.end_point = self.start_point = event.pos() self.__start = self.__end = windows.GetCursorPos() - self.startauto = False if self.is_drawing: self.end_point = event.pos() self.__end = windows.GetCursorPos() self.update() def getRange(self): - + if self.__start is None: + self.__start = self.__end x1, y1, x2, y2 = ( self.__start.x, self.__start.y, @@ -261,22 +248,27 @@ class rangeselect(QMainWindow): return ((x1, y1), (x2, y2)) + def callbackfunction(self, event): + if not self.once: + return + self.once = False + self.end_point = event.pos() + self.__end = windows.GetCursorPos() + self.close() + try: + self.callback(self.getRange()) + except: + print_exc() + def mouseReleaseEvent(self, event): if event.button() == Qt.MouseButton.LeftButton: - self.end_point = event.pos() - self.__end = windows.GetCursorPos() - - self.close() - if not self.once: - return - self.once = False - self.callback(self.getRange()) + self.callbackfunction(event) screen_shot_ui = None -def rangeselct_function(callback, clickrelease, startauto): +def rangeselct_function(callback, startauto): global screen_shot_ui if screen_shot_ui is None: screen_shot_ui = rangeselect() @@ -287,4 +279,3 @@ def rangeselct_function(callback, clickrelease, startauto): windows.SetFocus(int(screen_shot_ui.winId())) screen_shot_ui.startauto = startauto - screen_shot_ui.clickrelease = clickrelease diff --git a/LunaTranslator/LunaTranslator/gui/setting_textinput.py b/LunaTranslator/LunaTranslator/gui/setting_textinput.py index 6d610219..32beb52f 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_textinput.py +++ b/LunaTranslator/LunaTranslator/gui/setting_textinput.py @@ -316,12 +316,8 @@ def gethookembedgrid(self): ), ], [ - "使用最快翻译而非指定翻译器", - D_getsimpleswitch(globalconfig["embedded"], "as_fast_as_posible"), - ], - [ - "内嵌的翻译器", - "", + "使用指定翻译器", + D_getsimpleswitch(globalconfig["embedded"], "use_appointed_translate"), D_getsimplecombobox( alltransvis, globalconfig["embedded"], @@ -443,21 +439,15 @@ def filetranslate(self): [(functools.partial(createdownloadprogress, self), 0)], [], [ - "指定翻译器", - ( - D_getsimplecombobox( - alltransvis, - globalconfig["embedded"], - "translator_2", - internal=alltrans, - ), - 3, + "使用指定翻译器", + D_getsimpleswitch(globalconfig, "use_appointed_translate"), + D_getsimplecombobox( + alltransvis, + globalconfig, + "translator_2", + internal=alltrans, ), ], - [ - "使用最快翻译而非指定翻译器", - D_getsimpleswitch(globalconfig["embedded"], "as_fast_as_posible"), - ], ] return grids diff --git a/LunaTranslator/LunaTranslator/gui/setting_textinput_ocr.py b/LunaTranslator/LunaTranslator/gui/setting_textinput_ocr.py index 88847e8f..9b3efc30 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_textinput_ocr.py +++ b/LunaTranslator/LunaTranslator/gui/setting_textinput_ocr.py @@ -303,6 +303,9 @@ class showocrimage(saveposwindow): res = f[0] if not res: return + self.ocrfile(res) + + def ocrfile(self, res): img = QImage(res) if img.isNull(): return @@ -314,6 +317,17 @@ class showocrimage(saveposwindow): else: gobject.baseobject.textgetmethod(text, False) + def dragEnterEvent(self, event: QDragEnterEvent): + if event.mimeData().hasUrls(): + event.accept() + else: + event.ignore() + + def dropEvent(self, event: QDropEvent): + files = [u.toLocalFile() for u in event.mimeData().urls()] + if len(files): + self.ocrfile(files[0]) + def __init__(self, parent, cached): self.originimage = None super().__init__(parent, poslist=globalconfig["showocrgeo"]) @@ -322,6 +336,7 @@ class showocrimage(saveposwindow): self.originlabel = pixmapviewer() qw = QWidget() self.layout1 = QVBoxLayout() + self.setAcceptDrops(True) self.setCentralWidget(qw) qw.setLayout(self.layout1) icon = getIconButton(callback=self.openff, icon="fa.folder-open") @@ -342,6 +357,8 @@ class showocrimage(saveposwindow): self.setimagefunction(cached) def onValueChanged(self, value): + if not self.originimage: + return transform = QTransform() transform.rotate(value) rotated_image = self.originimage.transformed(transform) diff --git a/LunaTranslator/LunaTranslator/gui/showword.py b/LunaTranslator/LunaTranslator/gui/showword.py index c2155c19..dc453e31 100644 --- a/LunaTranslator/LunaTranslator/gui/showword.py +++ b/LunaTranslator/LunaTranslator/gui/showword.py @@ -95,7 +95,7 @@ class AnkiWindow(QWidget): if globalconfig["ankiconnect"]["ocrcroped"]: self.asyncocr(img) - rangeselct_function(ocroncefunction, False, False) + rangeselct_function(ocroncefunction, False) def __init__(self, p) -> None: super().__init__() diff --git a/LunaTranslator/LunaTranslator/gui/translatorUI.py b/LunaTranslator/LunaTranslator/gui/translatorUI.py index ba25a527..f0926baa 100644 --- a/LunaTranslator/LunaTranslator/gui/translatorUI.py +++ b/LunaTranslator/LunaTranslator/gui/translatorUI.py @@ -465,7 +465,7 @@ class TranslatorWindow(resizableframeless): self.ocr_once_follow_rect = rect self.ocr_do_function(rect) - rangeselct_function(ocroncefunction, False, False) + rangeselct_function(ocroncefunction, False) @threader def simulate_key_enter(self): @@ -1182,7 +1182,7 @@ class TranslatorWindow(resizableframeless): return self.showhidestate = False - rangeselct_function(self.afterrange, auto, auto) + rangeselct_function(self.afterrange, auto) @tryprint def afterrange(self, rect): diff --git a/LunaTranslator/LunaTranslator/myutils/config.py b/LunaTranslator/LunaTranslator/myutils/config.py index a9522376..cbd3d3b9 100644 --- a/LunaTranslator/LunaTranslator/myutils/config.py +++ b/LunaTranslator/LunaTranslator/myutils/config.py @@ -354,6 +354,12 @@ def get_launchpath(uid): def findgameuidofpath(gamepath, findall=False): + if not gamepath: + # getpidexe在部分情况下可能为None,导致崩溃 + if findall: + return [] + else: + return None, None gamepath = os.path.normpath(gamepath) collect = [] for sub in savegametaged: diff --git a/LunaTranslator/LunaTranslator/myutils/ocrutil.py b/LunaTranslator/LunaTranslator/myutils/ocrutil.py index cecc9801..df68c879 100644 --- a/LunaTranslator/LunaTranslator/myutils/ocrutil.py +++ b/LunaTranslator/LunaTranslator/myutils/ocrutil.py @@ -101,7 +101,7 @@ def __ocr_init(): def ocr_run(qimage: QImage): image = qimage2binary(qimage, "PNG") if not image: - return "" + return "", None global _nowuseocrx, _ocrengine try: ocr_init() diff --git a/LunaTranslator/LunaTranslator/rendertext/webview.html b/LunaTranslator/LunaTranslator/rendertext/webview.html index 3d5bc1aa..96294880 100644 --- a/LunaTranslator/LunaTranslator/rendertext/webview.html +++ b/LunaTranslator/LunaTranslator/rendertext/webview.html @@ -154,10 +154,6 @@ miaobian1: miaobian12_common, } function dispatch_text_style_line(style, styleargs, text, args) { - if (text == '') { - text = '
' - args.userawhtml = true - } let ele = regist_style_imp[style](styleargs, text, args); if (args.userawhtml) { if (args.atcenter) { diff --git a/LunaTranslator/LunaTranslator/rendertext/webview.py b/LunaTranslator/LunaTranslator/rendertext/webview.py index 0599e909..2f99c680 100644 --- a/LunaTranslator/LunaTranslator/rendertext/webview.py +++ b/LunaTranslator/LunaTranslator/rendertext/webview.py @@ -202,6 +202,9 @@ class TextBrowser(QWidget, dataget): t.start() def calllunaheightchange(self, h): + extra_space = globalconfig["extra_space"] + extra_space_trans = globalconfig["extra_space_trans"] + h += -min(0, extra_space, extra_space_trans) self.contentsChanged.emit( QSize( self._padding * 2 + self.width(), @@ -303,6 +306,11 @@ class TextBrowser(QWidget, dataget): # 显示名称时。不管了,就这样吧 text = text.replace(sig, "") userawhtml = True + + if len(text) == 0: + userawhtml = True + text = "
" + args = dict( atcenter=atcenter, fontFamily=fmori, diff --git a/LunaTranslator/LunaTranslator/textsource/filetrans.py b/LunaTranslator/LunaTranslator/textsource/filetrans.py index 8c2118ed..7dd4d830 100644 --- a/LunaTranslator/LunaTranslator/textsource/filetrans.py +++ b/LunaTranslator/LunaTranslator/textsource/filetrans.py @@ -77,7 +77,10 @@ class parsesrt: def __init__(self, file): self.file = file with open(file, "r", encoding="utf8") as ff: - self.blocks = ff.read().split("\n\n") + text = ff.read() + if text.endswith("\n"): + text = text[:-1] + self.blocks = text.split("\n\n") def __len__(self): return len(self.blocks) @@ -140,11 +143,9 @@ class filetrans(basetext): def query(self, origin): ts = self.__query(origin) - t = ts.get(globalconfig["embedded"]["translator_2"], None) - if t: - return t - if globalconfig["embedded"]["as_fast_as_posible"]: - return (list(ts.values()) + [None])[0] + if globalconfig["use_appointed_translate"]: + return ts.get(globalconfig["translator_2"], None) + return (list(ts.values()) + [None])[0] @threader def starttranslatefile(self, file): @@ -184,7 +185,12 @@ class filetrans(basetext): continue ts = self.query(line) if not ts: - ts = self.waitfortranslation(line) + engine = ( + globalconfig["translator_2"] + if globalconfig["use_appointed_translate"] + else None + ) + ts = self.waitfortranslation(line, engine) if self.ending: return diff --git a/LunaTranslator/LunaTranslator/textsource/texthook.py b/LunaTranslator/LunaTranslator/textsource/texthook.py index 6985dc9a..10e850aa 100644 --- a/LunaTranslator/LunaTranslator/textsource/texthook.py +++ b/LunaTranslator/LunaTranslator/textsource/texthook.py @@ -2,7 +2,7 @@ import threading import re, os import time, gobject, windows from collections import OrderedDict -import codecs, functools +import zhconv, functools from winsharedutils import Is64bit from myutils.config import ( globalconfig, @@ -16,6 +16,7 @@ from myutils.utils import ( getfilemd5, getlangtgt, getlanguagespace, + kanjitrans, safe_escape, ) from myutils.hwnd import injectdll, test_injectable, ListProcess, getpidexe @@ -450,9 +451,16 @@ class texthook(basetext): self.embedcallback(text, "") return if self.checkisusingembed(tp.addr, tp.ctx, tp.ctx2): - trans = self.waitfortranslation(text) + engine = ( + globalconfig["embedded"]["translator_2"] + if globalconfig["embedded"]["use_appointed_translate"] + else None + ) + trans = self.waitfortranslation(text, engine) if not trans: trans = "" + if globalconfig["embedded"]["trans_kanji"]: + trans = kanjitrans(zhconv.convert(trans, "zh-tw")) self.embedcallback(text, trans) def embedcallback(self, text: str, trans: str): diff --git a/LunaTranslator/LunaTranslator/textsource/textsourcebase.py b/LunaTranslator/LunaTranslator/textsource/textsourcebase.py index f45953fe..6f2df98a 100644 --- a/LunaTranslator/LunaTranslator/textsource/textsourcebase.py +++ b/LunaTranslator/LunaTranslator/textsource/textsourcebase.py @@ -51,12 +51,13 @@ class basetext: return self.textgetmethod(*arg, **kwarg) - def waitfortranslation(self, text): + def waitfortranslation(self, text, engine=None): resultwaitor = queue.Queue() self.textgetmethod( text, is_auto_run=True, waitforresultcallback=resultwaitor.put, + waitforresultcallbackengine=engine, ) return resultwaitor.get() diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index 8d33f79e..fc2ab612 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -303,14 +303,16 @@ "port": 2333 } }, + "translator_2": null, + "use_appointed_translate": false, "embedded": { "safecheck_use": true, "safecheckregexs": [ "(.*?)\\{(.*?)\\}(.*?)", "(.*?)\\[(.*?)\\](.*?)" ], - "translator_2": 0, - "as_fast_as_posible": true, + "translator_2": null, + "use_appointed_translate": false, "timeout_translate": 2, "trans_kanji": true, "keeprawtext": false, diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index e8c37f6e..c36d514a 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -362,7 +362,6 @@ "过滤重复": "تصفية التكرار", "搜索结果数上限": "نتائج البحث عن الحد الأعلى", "指示詞": "إشارة عشوائية", - "使用最快翻译而非指定翻译器": "استخدام أسرع مترجم بدلا من تحديد مترجم", "搜索": "بحث .", "不透明度": "التعتيم", "过滤乱码文本": "تصفية النص مشوه", @@ -823,5 +822,6 @@ "指定翻译器": "تعيين مترجم", "关于软件": "عن البرمجيات", "严格的": "صارم", - "收藏夹": "المفضلة" + "收藏夹": "المفضلة", + "使用指定翻译器": "استخدام محدد مترجم" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index 9c63baae..68c3bbfc 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "分析影像更新+週期執行", "调整游戏窗口按钮": "調整遊戲視窗按鈕", "内嵌的翻译器": "內嵌的翻譯器", - "使用最快翻译而非指定翻译器": "使用最快翻譯而非指定翻譯器", "代理设置": "代理設定", "自动更新": "自動更新", "排除复制自翻译器的文本": "排除複製自翻譯器的文字", @@ -823,5 +822,6 @@ "指定翻译器": "指定翻譯器", "关于软件": "關於軟件", "严格的": "嚴格的", - "收藏夹": "我的最愛" + "收藏夹": "我的最愛", + "使用指定翻译器": "使用指定翻譯器" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cs.json b/LunaTranslator/files/lang/cs.json index 85cde2a5..354af491 100644 --- a/LunaTranslator/files/lang/cs.json +++ b/LunaTranslator/files/lang/cs.json @@ -269,7 +269,6 @@ "默认设置": "výchozí nastavení", "意大利语": "Italština", "已保存游戏": "Uložená hra", - "使用最快翻译而非指定翻译器": "Použijte nejrychlejší překlad místo určení překladatele", "有道api": "Youdao API", "显示显示原文按钮": "Zobrazit tlačítko původního textu", "去除花括号{}": "Odstraňte kudrnaté rovnátka.", @@ -823,5 +822,6 @@ "指定翻译器": "Upřesnit překladatele", "关于软件": "O softwaru", "严格的": "přísná", - "收藏夹": "Oblíbené" + "收藏夹": "Oblíbené", + "使用指定翻译器": "Použít určeného překladatele" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/de.json b/LunaTranslator/files/lang/de.json index 8611b123..fc434d73 100644 --- a/LunaTranslator/files/lang/de.json +++ b/LunaTranslator/files/lang/de.json @@ -269,7 +269,6 @@ "默认设置": "Standardeinstellung", "意大利语": "Italienisch", "已保存游戏": "Gespeichertes Spiel", - "使用最快翻译而非指定翻译器": "Verwenden Sie die schnellste Übersetzung, anstatt einen Übersetzer anzugeben", "有道api": "Youdao API", "显示显示原文按钮": "Schaltfläche Originaltext anzeigen", "去除花括号{}": "Lockige Klammern entfernen {}", @@ -823,5 +822,6 @@ "指定翻译器": "Übersetzer angeben", "关于软件": "Über Software", "严格的": "streng", - "收藏夹": "Favoriten" + "收藏夹": "Favoriten", + "使用指定翻译器": "Verwende einen bestimmten Übersetzer" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index 6a1bc001..37987423 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "Analyze Image Update + Periodic Execution", "调整游戏窗口按钮": "Adjust Game Window Button", "内嵌的翻译器": "Embedded Translator", - "使用最快翻译而非指定翻译器": "Use Fastest Translation Engine Available", "代理设置": "Proxy Settings", "自动更新": "Auto Update", "排除复制自翻译器的文本": "Exclude Copied Text From Translator", @@ -823,5 +822,6 @@ "指定翻译器": "Specify translator", "关于软件": "About software", "严格的": "strict", - "收藏夹": "Favorites" + "收藏夹": "Favorites", + "使用指定翻译器": "Use designated translator" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index ad934200..37dd4312 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "Actualización de la imagen de análisis + Ejecución del ciclo", "调整游戏窗口按钮": "Ajustar el botón de la ventana del juego", "内嵌的翻译器": "Traductor incorporado", - "使用最快翻译而非指定翻译器": "Use la traducción más rápida en lugar del traductor especificado", "代理设置": "Configuración del agente", "自动更新": "Actualización automática", "排除复制自翻译器的文本": "Excluir el texto copiado del traductor", @@ -823,5 +822,6 @@ "指定翻译器": "Especificar traductor", "关于软件": "Sobre el software", "严格的": "Estricto", - "收藏夹": "Colección" + "收藏夹": "Colección", + "使用指定翻译器": "Uso del traductor especificado" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index 4daa1a3f..48e8e59d 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "Mise à jour de l'image analytique + exécution du cycle", "调整游戏窗口按钮": "Ajuster le bouton de la fenêtre de jeu", "内嵌的翻译器": "Traducteur intégré", - "使用最快翻译而非指定翻译器": "Utiliser la traduction la plus rapide au lieu du traducteur spécifié", "代理设置": "Paramètres de l'agent", "自动更新": "Mise à jour automatique", "排除复制自翻译器的文本": "Exclure le texte copié depuis le traducteur", @@ -823,5 +822,6 @@ "指定翻译器": "Spécifier le traducteur", "关于软件": "À propos du logiciel", "严格的": "Strictement", - "收藏夹": "Favoris" + "收藏夹": "Favoris", + "使用指定翻译器": "Utiliser le traducteur spécifié" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index 8706dffb..f52b07df 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -240,7 +240,6 @@ "说明": "spiegare", "分析图像更新+周期执行": "Analizza gli aggiornamenti delle immagini + esecuzione del ciclo", "内嵌的翻译器": "Traduttore incorporato", - "使用最快翻译而非指定翻译器": "Usa la traduzione più veloce invece di specificare un traduttore", "代理设置": "Impostazioni proxy", "自动更新": "Aggiornamento automatico", "排除复制自翻译器的文本": "Escludi testo copiato dal traduttore", @@ -823,5 +822,6 @@ "指定翻译器": "Specifica traduttore", "关于软件": "Informazioni sul software", "严格的": "severo", - "收藏夹": "Preferiti" + "收藏夹": "Preferiti", + "使用指定翻译器": "Usa traduttore designato" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index 79d108c4..b69c7508 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "解析画像更新+周期実行", "调整游戏窗口按钮": "ゲームウィンドウボタンを調整する", "内嵌的翻译器": "インライントランスレータ", - "使用最快翻译而非指定翻译器": "指定された翻訳器ではなく最速の翻訳を使用する", "代理设置": "プロキシ設定", "自动更新": "自動更新", "排除复制自翻译器的文本": "翻訳機からコピーされたテキストを除外する", @@ -823,5 +822,6 @@ "指定翻译器": "翻訳機の指定", "关于软件": "ソフトウェアについて", "严格的": "きびしい", - "收藏夹": "お気に入り" + "收藏夹": "お気に入り", + "使用指定翻译器": "指定された翻訳機の使用" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index 85e9167f..132f1348 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "분석 이미지 업데이트 + 주기 실행", "调整游戏窗口按钮": "게임 창 버튼 조정", "内嵌的翻译器": "내장된 번역기", - "使用最快翻译而非指定翻译器": "지정된 번역기가 아닌 가장 빠른 번역기 사용", "代理设置": "프록시 설정", "自动更新": "자동 업데이트", "排除复制自翻译器的文本": "번역기에서 복사한 텍스트 제외", @@ -823,5 +822,6 @@ "指定翻译器": "번역기 지정", "关于软件": "소프트웨어 정보", "严格的": "엄격했어", - "收藏夹": "즐겨찾기" + "收藏夹": "즐겨찾기", + "使用指定翻译器": "지정된 번역기 사용" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/nl.json b/LunaTranslator/files/lang/nl.json index 396742ce..5a68c366 100644 --- a/LunaTranslator/files/lang/nl.json +++ b/LunaTranslator/files/lang/nl.json @@ -269,7 +269,6 @@ "默认设置": "standaardinstelling", "意大利语": "Italiaans", "已保存游戏": "Opgeslagen spel", - "使用最快翻译而非指定翻译器": "Gebruik de snelste vertaling in plaats van een vertaler op te geven", "有道api": "Youdao API", "显示显示原文按钮": "Originele tekstknop weergeven", "去除花括号{}": "Krullende beugels verwijderen.", @@ -823,5 +822,6 @@ "指定翻译器": "Vertaler opgeven", "关于软件": "Over software", "严格的": "strikt", - "收藏夹": "Favorieten" + "收藏夹": "Favorieten", + "使用指定翻译器": "Gebruik aangewezen vertaler" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index d9d07424..57c3b530 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "Analiza aktualizacji obrazów+wykonanie cyklu", "调整游戏窗口按钮": "Dostosuj przyciski okna gry", "内嵌的翻译器": "Wbudowany tłumacz", - "使用最快翻译而非指定翻译器": "Użyj najszybszego tłumaczenia zamiast określać tłumacza", "代理设置": "Ustawienia proxy", "自动更新": "Automatyczna aktualizacja", "排除复制自翻译器的文本": "Wyklucz tekst skopiowany z tłumacza", @@ -823,5 +822,6 @@ "指定翻译器": "Określ tłumacza", "关于软件": "O oprogramowaniu", "严格的": "surowe", - "收藏夹": "Ulubione" + "收藏夹": "Ulubione", + "使用指定翻译器": "Użyj wyznaczonego tłumacza" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pt.json b/LunaTranslator/files/lang/pt.json index b13f341f..e15ba65c 100644 --- a/LunaTranslator/files/lang/pt.json +++ b/LunaTranslator/files/lang/pt.json @@ -269,7 +269,6 @@ "默认设置": "configuração predefinida", "意大利语": "Italiano", "已保存游戏": "Jogo gravado", - "使用最快翻译而非指定翻译器": "Usar a tradução mais rápida em vez de especificar um tradutor", "有道api": "API Youdao", "显示显示原文按钮": "Mostrar o botão do texto original", "去除花括号{}": "Remover as chaves encaracoladas {}", @@ -823,5 +822,6 @@ "指定翻译器": "Especificar o tradutor", "关于软件": "Sobre o software", "严格的": "estrito", - "收藏夹": "Favoritos" + "收藏夹": "Favoritos", + "使用指定翻译器": "Usar o tradutor designado" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index c779469b..a373af19 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "Анализ обновлений изображений + цикл выполнения", "调整游戏窗口按钮": "Настройка кнопки окна игры", "内嵌的翻译器": "Встроенный переводчик", - "使用最快翻译而非指定翻译器": "Используйте самый быстрый перевод вместо указанного переводчика", "代理设置": "Параметры прокси", "自动更新": "Автоматическое обновление", "排除复制自翻译器的文本": "Исключить копирование текста с переводчика", @@ -823,5 +822,6 @@ "指定翻译器": "Назначить переводчика", "关于软件": "О программном обеспечении", "严格的": "Строго", - "收藏夹": "Коллекция" + "收藏夹": "Коллекция", + "使用指定翻译器": "Использовать указанный переводчик" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/sv.json b/LunaTranslator/files/lang/sv.json index 3bff0ae0..eda69457 100644 --- a/LunaTranslator/files/lang/sv.json +++ b/LunaTranslator/files/lang/sv.json @@ -269,7 +269,6 @@ "默认设置": "förvald inställning", "意大利语": "Italienska", "已保存游戏": "Sparat spel", - "使用最快翻译而非指定翻译器": "Använd den snabbaste översättningen istället för att ange en översättare", "有道api": "Youdao API", "显示显示原文按钮": "Visa originaltextknapp", "去除花括号{}": "Ta bort lockiga hängslen", @@ -823,5 +822,6 @@ "指定翻译器": "Ange översättare", "关于软件": "Om programvara", "严格的": "strikt", - "收藏夹": "Favoriter" + "收藏夹": "Favoriter", + "使用指定翻译器": "Använd utsedd översättare" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index d8561991..0f123e55 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -268,7 +268,6 @@ "默认设置": "ตั้งค่าปริยาย", "意大利语": "อิตาลี", "已保存游戏": "บันทึกเกม", - "使用最快翻译而非指定翻译器": "ใช้การแปลที่เร็วที่สุดแทนการระบุนักแปล", "有道api": "มี Dao-api", "显示显示原文按钮": "แสดงปุ่มแสดงข้อความต้นฉบับ", "去除花括号{}": "ลบวงเล็บดอกไม้ {}", @@ -823,5 +822,6 @@ "指定翻译器": "ระบุนักแปล", "关于软件": "เกี่ยวกับซอฟต์แวร์", "严格的": "เข้มงวด", - "收藏夹": "รายการโปรด" + "收藏夹": "รายการโปรด", + "使用指定翻译器": "ใช้ตัวแปลที่ระบุ" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index 447ede87..531d2627 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "Görüntü güncellemesi", "调整游戏窗口按钮": "Oyun pencere düğmelerini ayarla", "内嵌的翻译器": "İçeri yatırılmış çevirici", - "使用最快翻译而非指定翻译器": "Tercümanı belirlemek yerine en hızlı tercüme kullanın", "代理设置": "Proksi Ayarları", "自动更新": "Otomatik güncelleştirme", "排除复制自翻译器的文本": "Tercümeden kopyalanan metin dışarı çıkar", @@ -823,5 +822,6 @@ "指定翻译器": "Çevirmeyi belirtin", "关于软件": "Yazılım hakkında", "严格的": "strict", - "收藏夹": "Favoritler" + "收藏夹": "Favoritler", + "使用指定翻译器": "Belirlenmiş tercümanları kullan" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index ceb21428..82fb7d39 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -240,7 +240,6 @@ "说明": "пояснити", "分析图像更新+周期执行": "Аналізувати оновлення зображення+виконання циклу", "内嵌的翻译器": "Вбудований перекладач", - "使用最快翻译而非指定翻译器": "Використовувати найшвидший переклад замість визначення перекладача", "代理设置": "Параметри проксі", "自动更新": "Автоматичне оновлення", "排除复制自翻译器的文本": "Виключити текст копіюваний з перекладача", @@ -823,5 +822,6 @@ "指定翻译器": "Вкажіть перекладач", "关于软件": "Про програмне забезпечення", "严格的": "strict", - "收藏夹": "Улюблені" + "收藏夹": "Улюблені", + "使用指定翻译器": "Використовувати вказаний перекладач" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index 6cdb205b..209843d7 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -246,7 +246,6 @@ "分析图像更新+周期执行": "Phân tích cập nhật hình ảnh+thực hiện chu kỳ", "调整游戏窗口按钮": "Điều chỉnh nút cửa sổ trò chơi", "内嵌的翻译器": "Trình dịch nội tuyến", - "使用最快翻译而非指定翻译器": "Sử dụng bản dịch nhanh nhất thay vì chỉ định", "代理设置": "Thiết lập ủy nhiệm", "自动更新": "Cập nhật tự động", "排除复制自翻译器的文本": "Loại trừ văn bản sao chép tự dịch", @@ -823,5 +822,6 @@ "指定翻译器": "Chỉ định trình dịch", "关于软件": "Về phần mềm", "严格的": "Nghiêm ngặt", - "收藏夹": "Yêu thích" + "收藏夹": "Yêu thích", + "使用指定翻译器": "Dùng bộ dịch đã chỉ định" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index 64029107..25cdec2d 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -269,7 +269,6 @@ "默认设置": "", "意大利语": "", "已保存游戏": "", - "使用最快翻译而非指定翻译器": "", "有道api": "", "显示显示原文按钮": "", "去除花括号{}": "", @@ -823,5 +822,6 @@ "指定翻译器": "", "关于软件": "", "严格的": "", - "收藏夹": "" + "收藏夹": "", + "使用指定翻译器": "" } \ No newline at end of file diff --git a/docs/en/embedtranslate.md b/docs/en/embedtranslate.md index 9b7aeb1c..b25048d4 100644 --- a/docs/en/embedtranslate.md +++ b/docs/en/embedtranslate.md @@ -54,9 +54,10 @@ Due to the limitation of the number of text lines that the game can display, by The principle of embedded translation is to pause the game in a certain function before the game displays the text, send the text to be displayed to the translator, wait for the translation, modify the text memory from the translated text, and then let the game continue to display the translation. Therefore, **when using a slower translation, it will definitely cause the game to stutter**. You can avoid long-term stuttering caused by slow translation by limiting the waiting time. -**3. Use the Fastest Translation Instead of Specified Translation** and **Embedded Translator** +**3. Use Specified Translator** + +When multiple translation sources are activated, you can choose to embed a specified translation with the best effect. If not activated, or if the specified translator is not activated, the fastest translation will be used to reduce game lag. -When activating multiple translation sources, you can choose to embed a specified translation that works best, or use the fastest translation to reduce game stuttering. **4. Convert Characters to Traditional/Japanese** diff --git a/docs/en/guochandamoxing.md b/docs/en/guochandamoxing.md index cad5c6e8..e7514e75 100644 --- a/docs/en/guochandamoxing.md +++ b/docs/en/guochandamoxing.md @@ -47,14 +47,6 @@ **model** https://openrouter.ai/docs/models -### **Deepbricks** - -**API Interface Address** `https://api.deepbricks.ai/v1/chat/completions` - -**API Key** https://deepbricks.ai/api-key - -**model** https://deepbricks.ai/pricing - ### **Mistral AI** **API Interface Address** `https://api.mistral.ai/v1/chat/completions` diff --git a/docs/en/ocrparam.md b/docs/en/ocrparam.md index 755c531c..5c455a09 100644 --- a/docs/en/ocrparam.md +++ b/docs/en/ocrparam.md @@ -1,4 +1,4 @@ -## Parameter Meaning for OCR Automation Execution Methods +## OCR Automation Execution Methods ### Analyze Image Update diff --git a/docs/en/offlinellm.md b/docs/en/offlinellm.md index 5b9f5c98..73b4a5d4 100644 --- a/docs/en/offlinellm.md +++ b/docs/en/offlinellm.md @@ -4,7 +4,7 @@ ### ChatGPT Compatible Interface -You can also use tools like [TGW](https://github.com/oobabooga/text-generation-webui), [llama.cpp](https://github.com/ggerganov/llama.cpp), [ollama](https://github.com/ollama/ollama), [one-api](https://github.com/songquanpeng/one-api) to deploy models, and then fill in the address and model. +You can also use tools like [llama.cpp](https://github.com/ggerganov/llama.cpp), [ollama](https://github.com/ollama/ollama), [one-api](https://github.com/songquanpeng/one-api) to deploy models, and then fill in the address and model. You can also use platforms like Kaggle to deploy models to the cloud, in which case you may need to use SECRET_KEY; otherwise, you can ignore the SECRET_KEY parameter. diff --git a/docs/en/sidebar.md b/docs/en/sidebar.md index 77b899d8..b60185a2 100644 --- a/docs/en/sidebar.md +++ b/docs/en/sidebar.md @@ -14,7 +14,7 @@ - [Embedded Translation](/en/embedtranslate.md) - [Playing Old Games on XP Virtual Machine and Extracting Text for Translation](/en/playonxp.md) - [OCR Related Settings](/en/ocrparam.redirect) - - [Parameter Meanings for OCR Automation Execution Methods](/en/ocrparam.md) + - [OCR Automation Execution Methods](/en/ocrparam.md) - [Installing Additional Language Support for Windows OCR](/en/windowsocr.md) - [What to Do If the mangaocr Integration Package Fails to Start](/en/mangaocr.md) - [Binding Game Window in OCR Mode](/en/gooduseocr.md) diff --git a/docs/index.html b/docs/index.html index 46b54b38..76e483eb 100644 --- a/docs/index.html +++ b/docs/index.html @@ -33,11 +33,11 @@ -
. +
视频教学
-
. +