From 739fa249446991ace8d52e2b65a4b56d72c67372 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: Fri, 30 Aug 2024 03:09:49 +0800 Subject: [PATCH] something --- .../LunaTranslator/LunaTranslator.py | 2 - .../LunaTranslator/gui/dialog_savedgame.py | 8 +-- .../gui/dialog_savedgame_common.py | 17 ++--- .../gui/dialog_savedgame_legacy.py | 4 +- .../gui/dialog_savedgame_setting.py | 64 ++++++++++++------- .../LunaTranslator/gui/dialog_savedgame_v3.py | 31 ++++----- .../LunaTranslator/gui/pretransfile.py | 2 +- .../LunaTranslator/gui/setting_textinput.py | 4 +- .../LunaTranslator/gui/usefulwidget.py | 29 +++++---- .../LunaTranslator/metadata/bangumi.py | 33 ++++++++-- .../LunaTranslator/metadata/vndb.py | 63 +++++++++++++++--- .../LunaTranslator/myutils/config.py | 6 ++ .../LunaTranslator/myutils/localetools.py | 9 ++- .../LunaTranslator/myutils/traceplaytime.py | 7 +- .../LunaTranslator/myutils/utils.py | 32 ++++++---- .../transoptimi/gptpromptdict.py | 4 +- .../LunaTranslator/transoptimi/noundict.py | 4 +- .../transoptimi/transerrorfix.py | 4 +- .../LunaTranslator/transoptimi/vndbnamemap.py | 6 +- .../files/defaultconfig/config.json | 2 +- LunaTranslator/files/lang/ar.json | 3 +- LunaTranslator/files/lang/cht.json | 3 +- LunaTranslator/files/lang/cs.json | 3 +- LunaTranslator/files/lang/de.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/nl.json | 3 +- LunaTranslator/files/lang/pl.json | 3 +- LunaTranslator/files/lang/pt.json | 3 +- LunaTranslator/files/lang/ru.json | 3 +- LunaTranslator/files/lang/sv.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 +- plugins/CMakeLists.txt | 4 +- 41 files changed, 248 insertions(+), 147 deletions(-) diff --git a/LunaTranslator/LunaTranslator/LunaTranslator.py b/LunaTranslator/LunaTranslator/LunaTranslator.py index 29a8364d..b3ebb51d 100644 --- a/LunaTranslator/LunaTranslator/LunaTranslator.py +++ b/LunaTranslator/LunaTranslator/LunaTranslator.py @@ -4,9 +4,7 @@ from qtsymbols import * from traceback import print_exc from myutils.config import ( globalconfig, - _TR, savehook_new_list, - uid2gamepath, findgameuidofpath, savehook_new_data, static_data, diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index 4c13c351..b322fd71 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -13,8 +13,8 @@ from gui.specialwidget import lazyscrollflow from myutils.config import ( savehook_new_data, savegametaged, - uid2gamepath, _TR, + get_launchpath, globalconfig, ) from gui.usefulwidget import ( @@ -182,7 +182,7 @@ class dialog_savedgame_new(QWidget): notshow = False for tag, _type, _ in tags: if _type == tagitem.TYPE_EXISTS: - if os.path.exists(uid2gamepath[k]) == False: + if os.path.exists(get_launchpath(k)) == False: notshow = True break elif _type == tagitem.TYPE_DEVELOPER: @@ -229,7 +229,7 @@ class dialog_savedgame_new(QWidget): othersetting = LAction(("其他设置")) if self.currentfocusuid: - exists = os.path.exists(uid2gamepath[self.currentfocusuid]) + exists = os.path.exists(get_launchpath(self.currentfocusuid)) if exists: menu.addAction(startgame) if exists: @@ -491,7 +491,7 @@ class dialog_savedgame_new(QWidget): _able1 = b and ( (not exists) or (self.currentfocusuid) - and (os.path.exists(uid2gamepath[self.currentfocusuid])) + and (os.path.exists(get_launchpath(self.currentfocusuid))) ) _btn.setEnabled(_able1) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_common.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_common.py index a469017f..5bb1b9e0 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_common.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_common.py @@ -12,12 +12,12 @@ from myutils.config import ( savehook_new_data, savegametaged, uid2gamepath, + get_launchpath, _TR, savehook_new_list, globalconfig, ) from gui.usefulwidget import ( - yuitsu_switch, getIconButton, FocusCombo, getsimplecombobox, @@ -114,17 +114,14 @@ class ItemWidget(QWidget): layout.addWidget(self._lb) self.setLayout(layout) self.gameuid = gameuid + exists = os.path.exists(get_launchpath(gameuid)) c = globalconfig["dialog_savegame_layout"][ - ("onfilenoexistscolor1", "backcolor1")[ - os.path.exists(uid2gamepath[gameuid]) - ] + ("onfilenoexistscolor1", "backcolor1")[exists] ] c = str2rgba( c, globalconfig["dialog_savegame_layout"][ - ("transparentnotexits", "transparent")[ - os.path.exists(uid2gamepath[gameuid]) - ] + ("transparentnotexits", "transparent")[exists] ], ) self.maskshowfileexists.setStyleSheet(f"background-color:{c};") @@ -345,7 +342,7 @@ class TagWidget(QWidget): def opendirforgameuid(gameuid): - f = uid2gamepath[gameuid] + f = get_launchpath(gameuid) f = os.path.dirname(f) if os.path.exists(f) and os.path.isdir(f): os.startfile(f) @@ -354,7 +351,7 @@ def opendirforgameuid(gameuid): @threader def startgame(gameuid): try: - game = uid2gamepath[gameuid] + game = get_launchpath(gameuid) if os.path.exists(game): mode = savehook_new_data[gameuid]["onloadautochangemode2"] if mode > 0: @@ -438,7 +435,7 @@ def getpixfunction(kk, small=False): def startgamecheck(self, reflist, gameuid): if not gameuid: return - if not os.path.exists(uid2gamepath[gameuid]): + if not os.path.exists(get_launchpath(gameuid)): return if globalconfig["startgamenototop"] == False: idx = reflist.index(gameuid) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_legacy.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_legacy.py index 6a3b7ba7..b4d6b9ad 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_legacy.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_legacy.py @@ -1,7 +1,7 @@ from PyQt5.QtWidgets import QWidget from qtsymbols import * import functools, threading -from myutils.config import savehook_new_list, savehook_new_data, uid2gamepath +from myutils.config import savehook_new_list, savehook_new_data, get_launchpath from myutils.hwnd import getExeIcon from gui.usefulwidget import ( TableViewW, @@ -131,7 +131,7 @@ class dialog_savedgame_legacy(QWidget): "", "", functools.partial(opendirforgameuid, k), - qicon=getExeIcon(uid2gamepath[k], cache=True), + qicon=getExeIcon(get_launchpath(k), cache=True), ) def callback_leuse(self, k, use): diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py index 5585d6b3..a5a8c69a 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_setting.py @@ -8,6 +8,7 @@ import gobject from myutils.config import ( savehook_new_data, uid2gamepath, + get_launchpath, _TR, postprocessconfig, globalconfig, @@ -51,8 +52,15 @@ from gui.usefulwidget import ( getspinbox, listediterline, ) -from gui.dynalang import LFormLayout, LPushButton, LStandardItemModel, LAction, LLabel, LDialog -from gui.dialog_savedgame_common import tagitem, TagWidget +from gui.dynalang import ( + LFormLayout, + LPushButton, + LStandardItemModel, + LAction, + LLabel, + LDialog, +) +from gui.dialog_savedgame_common import tagitem, TagWidget @Singleton @@ -155,7 +163,7 @@ class browserdialog(saveposwindow): def __init__(self, parent, gameuid=None) -> None: super().__init__(parent, poslist=globalconfig["browserwidget"]) if gameuid: - self.setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) + self.setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True)) self.browser = auto_select_webview(self) self.tagswidget = TagWidget(self) @@ -274,20 +282,12 @@ def maybehavebutton(self, gameuid, post): class dialog_setting_game_internal(QWidget): - def selectexe(self): - originpath = uid2gamepath[self.gameuid] - f = QFileDialog.getOpenFileName(directory=originpath) - res = f[0] - if res == "": - return - # 修改路径允许路径重复 - # 添加路径实际上也允许重复,只不过会去重。 + def selectexe(self, res): res = os.path.normpath(res) uid2gamepath[self.gameuid] = res - _icon = getExeIcon(res, cache=True) + _icon = getExeIcon(get_launchpath(self.gameuid), cache=True) self.setWindowIcon(_icon) - self.editpath.setText(res) def __init__(self, parent, gameuid) -> None: super().__init__(parent) @@ -295,14 +295,16 @@ class dialog_setting_game_internal(QWidget): formLayout = LFormLayout() self.setLayout(vbox) self.gameuid = gameuid - self.editpath = QLineEdit(uid2gamepath[gameuid]) - self.editpath.setReadOnly(True) formLayout.addRow( "路径", getboxlayout( [ - self.editpath, - getIconButton(functools.partial(self.selectexe), icon="fa.gear"), + getsimplepatheditor( + uid2gamepath[gameuid], + callback=self.selectexe, + clearable=False, + icons=("fa.gear",), + ), getIconButton( lambda: browserdialog( gobject.baseobject.commonstylebase, gameuid @@ -476,6 +478,15 @@ class dialog_setting_game_internal(QWidget): layout.addWidget(w) do() + def selectexe_lauch(self, p): + if p: + p = os.path.normpath(p) + savehook_new_data[self.gameuid]["launchpath"] = p + + _icon = getExeIcon(get_launchpath(self.gameuid), cache=True) + + self.setWindowIcon(_icon) + def starttab(self, formLayout: LFormLayout, gameuid): box = QGroupBox() settinglayout = LFormLayout() @@ -490,14 +501,23 @@ class dialog_setting_game_internal(QWidget): box.show() __launch_method = getsimplecombobox( - [_.name for _ in getgamecamptools(uid2gamepath[gameuid])], + [_.name for _ in getgamecamptools(get_launchpath(gameuid))], savehook_new_data[gameuid], "launch_method", - internal=[_.id for _ in getgamecamptools(uid2gamepath[gameuid])], + internal=[_.id for _ in getgamecamptools(get_launchpath(gameuid))], callback=functools.partial( __, box, settinglayout, savehook_new_data[gameuid] ), ) + formLayout.addRow( + "启动程序", + getsimplepatheditor( + get_launchpath(gameuid), + callback=self.selectexe_lauch, + icons=("fa.gear", "fa.window-close-o"), + clearset=uid2gamepath[gameuid], + ), + ) formLayout.addRow("启动方式", __launch_method) formLayout.addRow(box) @@ -779,7 +799,7 @@ class dialog_setting_game_internal(QWidget): False, filt, functools.partial(selectimg, gameuid, key), - True, + icons=("fa.folder-open", "fa.window-close-o"), ), ) @@ -1114,7 +1134,6 @@ class dialog_setting_game_internal(QWidget): ) - def calculate_centered_rect(original_rect: QRect, size: QSize) -> QRect: original_center = original_rect.center() new_left = original_center.x() - size.width() // 2 @@ -1122,6 +1141,7 @@ def calculate_centered_rect(original_rect: QRect, size: QSize) -> QRect: new_rect = QRect(new_left, new_top, size.width(), size.height()) return new_rect + @Singleton_close class dialog_setting_game(LDialog): @@ -1131,7 +1151,7 @@ class dialog_setting_game(LDialog): self.setWindowTitle(savehook_new_data[gameuid]["title"]) - self.setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) + self.setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True)) _ = dialog_setting_game_internal(self, gameuid) _.methodtab.setCurrentIndex(setindexhook) _.setMinimumSize(QSize(600, 500)) diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_v3.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_v3.py index b08aa2ef..bfbfda7b 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame_v3.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame_v3.py @@ -8,7 +8,7 @@ from myutils.config import ( savehook_new_list, savehook_new_data, savegametaged, - uid2gamepath, + get_launchpath, extradatas, globalconfig, ) @@ -96,16 +96,14 @@ class clickitem(QWidget): self.lay.setContentsMargins(0, 0, 0, 0) self.maskshowfileexists = QLabel(self) - + exits = os.path.exists(get_launchpath(uid)) c = globalconfig["dialog_savegame_layout"][ - ("onfilenoexistscolor1", "backcolor1")[os.path.exists(uid2gamepath[uid])] + ("onfilenoexistscolor1", "backcolor1")[exits] ] c = str2rgba( c, globalconfig["dialog_savegame_layout"][ - ("transparentnotexits", "transparent")[ - os.path.exists(uid2gamepath[uid]) - ] + ("transparentnotexits", "transparent")[exits] ], ) self.maskshowfileexists.setStyleSheet(f"background-color:{c};") @@ -121,9 +119,7 @@ class clickitem(QWidget): _.setFixedSize(QSize(size, size)) _.setScaledContents(True) _.setStyleSheet("background-color: rgba(255,255,255, 0);") - icon = getpixfunction( - uid, small=True - ) # getExeIcon(uid2gamepath[uid], icon=False, cache=True) + icon = getpixfunction(uid, small=True) icon.setDevicePixelRatio(self.devicePixelRatioF()) _.setPixmap(icon) self.lay.addWidget(_) @@ -229,19 +225,17 @@ class MyQListWidget(QListWidget): end = self.indexAt(self.viewport().rect().bottomRight()).row() if start < 0: return - if end < 0: - end = start with self.lock: model = self.model() + if end < 0: + end = model.rowCount() for row in range(start, end + 1): index = model.index(row, 0) if not index.data(ImageRequestedRole): self.model().setData(index, True, ImageRequestedRole) image = getcachedimage(index.data(PathRole), True) if image is None: - self.blockSignals(True) self.takeItem(index.row()) - self.blockSignals(False) else: self.item(index.row()).setIcon(QIcon(image)) except: @@ -670,7 +664,7 @@ class dialog_savedgame_v3(QWidget): _able1 = b and ( (not exists) or (self.currentfocusuid) - and (os.path.exists(uid2gamepath[self.currentfocusuid])) + and (os.path.exists(get_launchpath(self.currentfocusuid))) ) _btn.setEnabled(_able1) if self.currentfocusuid: @@ -712,7 +706,7 @@ class dialog_savedgame_v3(QWidget): menu.addAction(addlist) else: - exists = os.path.exists(uid2gamepath[self.currentfocusuid]) + exists = os.path.exists(get_launchpath(self.currentfocusuid)) if exists: menu.addAction(startgame) menu.addAction(delgame) @@ -862,10 +856,9 @@ class dialog_savedgame_v3(QWidget): self.stack.insertw(i, group0) rowreal = 0 for row, k in enumerate(lst): - if globalconfig["hide_not_exists"] and not os.path.exists( - uid2gamepath[k] - ): - continue + if globalconfig["hide_not_exists"]: + if not os.path.exists(get_launchpath(k)): + continue self.reallist[tagid].append(k) if opened and isfirst and (rowreal == 0): vis = True diff --git a/LunaTranslator/LunaTranslator/gui/pretransfile.py b/LunaTranslator/LunaTranslator/gui/pretransfile.py index e1bd564c..79a3e56a 100644 --- a/LunaTranslator/LunaTranslator/gui/pretransfile.py +++ b/LunaTranslator/LunaTranslator/gui/pretransfile.py @@ -3,7 +3,7 @@ import sqlite3, os, json, functools from traceback import print_exc from myutils.config import globalconfig, _TR from myutils.utils import autosql -from gui.usefulwidget import getQMessageBox, LFocusCombo, getsimplepatheditor +from gui.usefulwidget import getQMessageBox, LFocusCombo from gui.dynalang import LFormLayout, LPushButton, LDialog from textsource.texthook import splitembedlines from collections import Counter diff --git a/LunaTranslator/LunaTranslator/gui/setting_textinput.py b/LunaTranslator/LunaTranslator/gui/setting_textinput.py index f69569f2..4ce36a42 100644 --- a/LunaTranslator/LunaTranslator/gui/setting_textinput.py +++ b/LunaTranslator/LunaTranslator/gui/setting_textinput.py @@ -6,7 +6,7 @@ from myutils.config import ( globalconfig, _TR, savehook_new_data, - uid2gamepath, + get_launchpath, savehook_new_list, static_data, ) @@ -224,7 +224,7 @@ def exportchspatch(self): gameuid = selectgameuid(self) if gameuid is None: return - exe = uid2gamepath[gameuid] + exe = get_launchpath(gameuid) if exe.lower().endswith(".exe") == False: f = QFileDialog.getOpenFileName( self, caption=_TR("选择EXE文件"), filter="*.exe" diff --git a/LunaTranslator/LunaTranslator/gui/usefulwidget.py b/LunaTranslator/LunaTranslator/gui/usefulwidget.py index 4bc2499d..e3371319 100644 --- a/LunaTranslator/LunaTranslator/gui/usefulwidget.py +++ b/LunaTranslator/LunaTranslator/gui/usefulwidget.py @@ -2035,11 +2035,13 @@ def getsimplepatheditor( isdir=False, filter1="*.*", callback=None, - useiconbutton=False, + icons=None, reflist=None, name=None, header=None, dirorfile=False, + clearable=True, + clearset="" ): lay = QHBoxLayout() lay.setContentsMargins(0, 0, 0, 0) @@ -2055,12 +2057,14 @@ def getsimplepatheditor( else: e = QLineEdit(text) e.setReadOnly(True) - if useiconbutton: - bu = getIconButton(icon="fa.folder-open") - clear = getIconButton(icon="fa.window-close-o") + if icons: + bu = getIconButton(icon=icons[0]) + if clearable: + clear = getIconButton(icon=icons[1]) else: bu = LPushButton("选择" + ("文件夹" if isdir else "文件")) - clear = LPushButton("清除") + if clearable: + clear = LPushButton("清除") bu.clicked.connect( functools.partial( openfiledirectory, @@ -2072,15 +2076,16 @@ def getsimplepatheditor( callback, ) ) - - def __(_cb, _e): - _cb("") - _e.setText("") - - clear.clicked.connect(functools.partial(__, callback, e)) lay.addWidget(e) lay.addWidget(bu) - lay.addWidget(clear) + if clearable: + + def __(_cb, _e, t): + _cb("") + _e.setText(t) + + clear.clicked.connect(functools.partial(__, callback, e, clearset)) + lay.addWidget(clear) return lay diff --git a/LunaTranslator/LunaTranslator/metadata/bangumi.py b/LunaTranslator/LunaTranslator/metadata/bangumi.py index 6f3d34e4..980aac35 100644 --- a/LunaTranslator/LunaTranslator/metadata/bangumi.py +++ b/LunaTranslator/LunaTranslator/metadata/bangumi.py @@ -4,7 +4,6 @@ from myutils.utils import initanewitem, gamdidchangedtask import functools, time, json, gobject from qtsymbols import * from metadata.abstract import common -from gui.usefulwidget import getlineedit from gui.dialog_savedgame import getreflist, getalistname from myutils.wrapper import Singleton_close, threader from gui.dynalang import LPushButton @@ -121,9 +120,11 @@ class bgmsettings(QDialog): getalistname(self, callback) infosig = pyqtSignal(str) + showhide = pyqtSignal(bool) @threader def checkvalid(self, k): + self.showhide.emit(False) self.lbinfo.setText("") t = time.time() self.tm = t @@ -146,6 +147,17 @@ class bgmsettings(QDialog): expires = response.get("expires", 0) if expires: info = "" + try: + response1 = requests.get( + f"https://api.bgm.tv/v0/me", + params={"access_token": k}, + headers=self.headers, + proxies=self._ref.proxy, + ) + print(response1.json()) + info += "用户名: " + response1.json()["nickname"] + "\n" + except: + pass try: create = ( json.loads(response["info"]) @@ -160,10 +172,12 @@ class bgmsettings(QDialog): info += "有效期至: " + time.strftime( "%Y-%m-%d %H:%M:%S", time.localtime(expires) ) + self.showhide.emit(True) else: info = " ".join( (response.get("error", ""), response.get("error_description", "")) ) + self.showhide.emit(False) self.lbinfo.setText(info) def __oauth(self): @@ -223,7 +237,13 @@ class bgmsettings(QDialog): s = QLineEdit() self.lbinfo = QLabel() s.textChanged.connect(self.checkvalid) - s.setText(_ref.config["access-token"]) + fl2 = QFormLayout() + fl2.setContentsMargins(0, 0, 0, 0) + ww = QWidget() + ww.setLayout(fl2) + ww.hide() + self.fl2 = ww + self.showhide.connect(self.fl2.setVisible) self._token = s vbox.addLayout(hbox) hbox.addWidget(s) @@ -232,22 +252,23 @@ class bgmsettings(QDialog): oauth.clicked.connect(self.__oauth) vbox.addWidget(self.lbinfo) fl.addRow("access-token", vbox) - btn = LPushButton("上传游戏") btn.clicked.connect( functools.partial(self.singleupload_existsoverride, gameuid) ) - fl.addRow(btn) + fl2.addRow(btn) btn = LPushButton("上传游戏列表") btn.clicked.connect( functools.partial(self.__getalistname, self.getalistname_upload) ) - fl.addRow(btn) + fl2.addRow(btn) btn = LPushButton("获取游戏列表") btn.clicked.connect( functools.partial(self.__getalistname, self.getalistname_download) ) - fl.addRow(btn) + fl2.addRow(btn) + fl.addRow(ww) + s.setText(_ref.config["access-token"]) self.show() diff --git a/LunaTranslator/LunaTranslator/metadata/vndb.py b/LunaTranslator/LunaTranslator/metadata/vndb.py index 8a1956bd..6f3bb1fb 100644 --- a/LunaTranslator/LunaTranslator/metadata/vndb.py +++ b/LunaTranslator/LunaTranslator/metadata/vndb.py @@ -6,13 +6,12 @@ import time from qtsymbols import * from gui.inputdialog import autoinitdialog from metadata.abstract import common -from gui.usefulwidget import getlineedit from gui.dialog_savedgame import getreflist, getalistname -from myutils.wrapper import Singleton_close +from myutils.wrapper import Singleton_close, threader from gui.dynalang import LPushButton -def saferequestvndb(proxy, method, url, json=None, headers=None): +def saferequestvndb(proxy, method, url, json=None, headers=None, failnone=True): print(method, url, json) resp = requests.request( method, @@ -35,11 +34,14 @@ def saferequestvndb(proxy, method, url, json=None, headers=None): except: print(resp.status_code) print(resp.text) - return None + if failnone: + return None + else: + return resp.text -def safegetvndbjson(proxy, url, json): - return saferequestvndb(proxy, "POST", url, json) +def safegetvndbjson(proxy, url, json=None, headers=None): + return saferequestvndb(proxy, "POST", url, json, headers) def gettitlefromjs(js): @@ -279,28 +281,69 @@ class vndbsettings(QDialog): def __getalistname(self, callback, _): getalistname(self, callback) + showhide = pyqtSignal(bool) + + @threader + def checkvalid(self, k): + self.showhide.emit(False) + self.lbinfo.setText("") + t = time.time() + self.tm = t + if k != self._ref.config["Token"]: + self._ref.config["Token"] = k + response = saferequestvndb( + self._ref.proxy, "GET", "authinfo", headers=self.headers, failnone=False + ) + if t != self.tm: + return + print(response) + if isinstance(response, dict) and response.get("username"): + info = "username: " + response.get("username") + self.showhide.emit(True) + else: + info = response + self.showhide.emit(False) + self.lbinfo.setText(info) + def __init__(self, parent, _ref: common, gameuid: str) -> None: super().__init__(parent, Qt.WindowType.WindowCloseButtonHint) + self.tm = None self._ref = _ref self.resize(QSize(800, 10)) self.setWindowTitle(self._ref.config_all["name"]) fl = QFormLayout(self) - fl.addRow("Token", getlineedit(_ref.config, "Token")) + vbox = QVBoxLayout() + s = QLineEdit() + self.lbinfo = QLabel() + s.textChanged.connect(self.checkvalid) + fl2 = QFormLayout() + fl2.setContentsMargins(0, 0, 0, 0) + ww = QWidget() + ww.setLayout(fl2) + ww.hide() + self.fl2 = ww + self.showhide.connect(self.fl2.setVisible) + self._token = s + vbox.addWidget(s) + vbox.addWidget(self.lbinfo) + fl.addRow("Token", vbox) btn = LPushButton("上传游戏") btn.clicked.connect( functools.partial(self.singleupload_existsoverride, gameuid) ) - fl.addRow(btn) + fl2.addRow(btn) btn = LPushButton("上传游戏列表") btn.clicked.connect( functools.partial(self.__getalistname, self.getalistname_upload) ) - fl.addRow(btn) + fl2.addRow(btn) btn = LPushButton("获取游戏列表") btn.clicked.connect( functools.partial(self.__getalistname, self.getalistname_download) ) - fl.addRow(btn) + fl2.addRow(btn) + fl.addRow(ww) + s.setText(_ref.config["Token"]) self.show() diff --git a/LunaTranslator/LunaTranslator/myutils/config.py b/LunaTranslator/LunaTranslator/myutils/config.py index 703c9f0e..90ebe671 100644 --- a/LunaTranslator/LunaTranslator/myutils/config.py +++ b/LunaTranslator/LunaTranslator/myutils/config.py @@ -118,6 +118,7 @@ ocrsetting = tryreadconfig("ocrsetting.json") def getdefaultsavehook(title=None): default = { "gamepath": "", # 不要直接访问,要通过uid2gamepath来间接访问 + #"launchpath": "", "hooksetting_follow_default": True, "hooksetting_private": {}, # 显示时再加载,缺省用global中的键 "textproc_follow_default": True, @@ -336,6 +337,11 @@ class __uid2gamepath: uid2gamepath = __uid2gamepath() +def get_launchpath(uid): + launch = savehook_new_data[uid].get("launchpath", "") + if not launch: + launch = uid2gamepath[uid] + return launch def findgameuidofpath(gamepath, findall=False): collect = [] diff --git a/LunaTranslator/LunaTranslator/myutils/localetools.py b/LunaTranslator/LunaTranslator/myutils/localetools.py index 6c1a8533..b52c303a 100644 --- a/LunaTranslator/LunaTranslator/myutils/localetools.py +++ b/LunaTranslator/LunaTranslator/myutils/localetools.py @@ -1,6 +1,6 @@ -import windows, os, winreg, winsharedutils, re, functools +import windows, os, winsharedutils, re, functools from qtsymbols import * -from myutils.config import savehook_new_data, uid2gamepath, globalconfig +from myutils.config import savehook_new_data, get_launchpath, globalconfig from gui.usefulwidget import ( getlineedit, getsimplecombobox, @@ -12,7 +12,6 @@ from gui.usefulwidget import ( getsimplepatheditor, clearlayout, ) -from traceback import print_exc from gui.dynalang import LFormLayout @@ -529,9 +528,9 @@ def fundlauncher(_id): def localeswitchedrun(gameuid): config = savehook_new_data[gameuid] launch_method = config.get("launch_method", None) - gameexe = uid2gamepath[gameuid] + gameexe = get_launchpath(gameuid) tools = getgamecamptools(gameexe) - ids = [_.id for _ in getgamecamptools(uid2gamepath[gameuid])] + ids = [_.id for _ in tools] if launch_method not in ids: index = 0 else: diff --git a/LunaTranslator/LunaTranslator/myutils/traceplaytime.py b/LunaTranslator/LunaTranslator/myutils/traceplaytime.py index 42909505..f06cb9a6 100644 --- a/LunaTranslator/LunaTranslator/myutils/traceplaytime.py +++ b/LunaTranslator/LunaTranslator/myutils/traceplaytime.py @@ -3,12 +3,7 @@ import time import os, threading from qtsymbols import * from traceback import print_exc -from myutils.config import ( - uid2gamepath, - findgameuidofpath, - savehook_new_list, - savehook_new_data, -) +from myutils.config import findgameuidofpath, savehook_new_data from myutils.hwnd import getpidexe import windows import gobject diff --git a/LunaTranslator/LunaTranslator/myutils/utils.py b/LunaTranslator/LunaTranslator/myutils/utils.py index 3250a9d9..24f32de7 100644 --- a/LunaTranslator/LunaTranslator/myutils/utils.py +++ b/LunaTranslator/LunaTranslator/myutils/utils.py @@ -20,7 +20,6 @@ from myutils.config import ( import threading, winreg import re, heapq, winsharedutils from myutils.wrapper import tryprint, threader -from myutils.subproc import subproc_w def checkisusingwine(): @@ -195,17 +194,19 @@ def dispatchsearchfordata(gameuid, target, vid): targetmod[target].dispatchsearchfordata(gameuid, vid) -def trysearchforid_1(gameuid, searchargs: list): +def trysearchforid_1(gameuid, searchargs: list, target=None): infoid = None - primitivtemetaorigin = globalconfig["primitivtemetaorigin"] - __ = [primitivtemetaorigin] - for k in targetmod: - if k == primitivtemetaorigin: - continue - if not globalconfig["metadata"][k]["auto"]: - continue - __.append(k) - + if target is None: + primitivtemetaorigin = globalconfig["primitivtemetaorigin"] + __ = [primitivtemetaorigin] + for k in targetmod: + if k == primitivtemetaorigin: + continue + if not globalconfig["metadata"][k]["auto"]: + continue + __.append(k) + else: + __ = [target] for key in __: vid = None for arg in searchargs: @@ -232,13 +233,16 @@ def trysearchforid_1(gameuid, searchargs: list): dispatchsearchfordata(gameuid, key, vid) -def trysearchforid(gameuid, searchargs: list): - threading.Thread(target=trysearchforid_1, args=(gameuid, searchargs)).start() +def trysearchforid(*argc): + threading.Thread(target=trysearchforid_1, args=argc).start() def gamdidchangedtask(key, idname, gameuid): vid = savehook_new_data[gameuid].get(idname, "") - dispatchsearchfordata(gameuid, key, vid) + if not vid: + trysearchforid(gameuid, [savehook_new_data[gameuid]["title"]], key) + else: + dispatchsearchfordata(gameuid, key, vid) def titlechangedtask(gameuid, title): diff --git a/LunaTranslator/LunaTranslator/transoptimi/gptpromptdict.py b/LunaTranslator/LunaTranslator/transoptimi/gptpromptdict.py index 8c2afd93..f1a8ab33 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/gptpromptdict.py +++ b/LunaTranslator/LunaTranslator/transoptimi/gptpromptdict.py @@ -1,4 +1,4 @@ -from myutils.config import globalconfig, savehook_new_data, uid2gamepath +from myutils.config import globalconfig, savehook_new_data, get_launchpath from myutils.utils import postusewhich from gui.inputdialog import postconfigdialog_ import gobject @@ -24,7 +24,7 @@ class Process: "专有名词翻译_sakura_gpt_词典_-_" + savehook_new_data[gameuid]["title"], ["原文", "翻译", "注释"], dictkeys=["src", "dst", "info"], - ).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) + ).setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True)) def process_before(self, japanese): diff --git a/LunaTranslator/LunaTranslator/transoptimi/noundict.py b/LunaTranslator/LunaTranslator/transoptimi/noundict.py index 7d18439f..8b0c6299 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/noundict.py +++ b/LunaTranslator/LunaTranslator/transoptimi/noundict.py @@ -5,7 +5,7 @@ from gui.usefulwidget import threebuttons, TableViewW from myutils.wrapper import Singleton_close from myutils.utils import postusewhich from gui.dynalang import LDialog, LPushButton, LStandardItemModel -from myutils.config import uid2gamepath +from myutils.config import get_launchpath from myutils.hwnd import getExeIcon @@ -114,7 +114,7 @@ class Process: parent_window, savehook_new_data[gameuid]["noundictconfig"], "专有名词翻译_占位符_-_" + savehook_new_data[gameuid]["title"], - ).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) + ).setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True)) @staticmethod def get_setting_window(parent_window): diff --git a/LunaTranslator/LunaTranslator/transoptimi/transerrorfix.py b/LunaTranslator/LunaTranslator/transoptimi/transerrorfix.py index 9bd5888d..7d02b1c2 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/transerrorfix.py +++ b/LunaTranslator/LunaTranslator/transoptimi/transerrorfix.py @@ -2,7 +2,7 @@ from myutils.config import transerrorfixdictconfig, savehook_new_data from myutils.utils import parsemayberegexreplace, postusewhich from gui.inputdialog import noundictconfigdialog1 import gobject -from myutils.config import uid2gamepath +from myutils.config import get_launchpath from myutils.hwnd import getExeIcon @@ -24,7 +24,7 @@ class Process: savehook_new_data[gameuid]["transerrorfix"], "翻译结果修正_-_" + savehook_new_data[gameuid]["title"], ["正则",'转义', "翻译", "替换"], - ).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) + ).setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True)) def process_after(self, res, mp1): res = parsemayberegexreplace(self.usewhich(), res) diff --git a/LunaTranslator/LunaTranslator/transoptimi/vndbnamemap.py b/LunaTranslator/LunaTranslator/transoptimi/vndbnamemap.py index 8a90cc54..a285c49b 100644 --- a/LunaTranslator/LunaTranslator/transoptimi/vndbnamemap.py +++ b/LunaTranslator/LunaTranslator/transoptimi/vndbnamemap.py @@ -1,7 +1,7 @@ -from myutils.config import globalconfig, savehook_new_data, uid2gamepath +from myutils.config import globalconfig, savehook_new_data, get_launchpath from myutils.utils import postusewhich, parsemayberegexreplace from gui.inputdialog import noundictconfigdialog1 -import gobject, json, functools +import gobject from myutils.hwnd import getExeIcon @@ -26,7 +26,7 @@ class Process: savehook_new_data[gameuid]["namemap2"], "专有名词翻译_直接替换_-_" + savehook_new_data[gameuid]["title"], ["正则", "转义", "原文", "翻译"], - ).setWindowIcon(getExeIcon(uid2gamepath[gameuid], cache=True)) + ).setWindowIcon(getExeIcon(get_launchpath(gameuid), cache=True)) @property def using_X(self): diff --git a/LunaTranslator/files/defaultconfig/config.json b/LunaTranslator/files/defaultconfig/config.json index 4744e044..20ea1ecd 100644 --- a/LunaTranslator/files/defaultconfig/config.json +++ b/LunaTranslator/files/defaultconfig/config.json @@ -1943,7 +1943,7 @@ "type": "api", "use": false, "color": "blue", - "name": "Azure Openai", + "name": "Azure", "is_gpt_like": true }, "cohere": { diff --git a/LunaTranslator/files/lang/ar.json b/LunaTranslator/files/lang/ar.json index f4eb3ff6..0d83ead6 100644 --- a/LunaTranslator/files/lang/ar.json +++ b/LunaTranslator/files/lang/ar.json @@ -846,5 +846,6 @@ "单词": "كلمة .", "成功添加后关闭窗口": "إغلاق النافذة بعد إضافة ناجحة", "绑定窗口": "ملزمة نافذة", - "(点击自己取消)": "( انقر على نفسك لإلغاء )" + "(点击自己取消)": "( انقر على نفسك لإلغاء )", + "启动程序": "بدء البرنامج" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cht.json b/LunaTranslator/files/lang/cht.json index ffe73bae..54ea9070 100644 --- a/LunaTranslator/files/lang/cht.json +++ b/LunaTranslator/files/lang/cht.json @@ -846,5 +846,6 @@ "单词": "單詞", "成功添加后关闭窗口": "成功添加後關閉窗口", "绑定窗口": "綁定視窗", - "(点击自己取消)": "(點擊自己取消)" + "(点击自己取消)": "(點擊自己取消)", + "启动程序": "啟動程式" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/cs.json b/LunaTranslator/files/lang/cs.json index 05f3c8ea..540e7c4a 100644 --- a/LunaTranslator/files/lang/cs.json +++ b/LunaTranslator/files/lang/cs.json @@ -846,5 +846,6 @@ "单词": "slovo", "成功添加后关闭窗口": "Zavřít okno po úspěšném přidání", "绑定窗口": "Vázat okno", - "(点击自己取消)": "(Kliknutím zrušíte sami)" + "(点击自己取消)": "(Kliknutím zrušíte sami)", + "启动程序": "Spustit program" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/de.json b/LunaTranslator/files/lang/de.json index b082d8ed..b66645c6 100644 --- a/LunaTranslator/files/lang/de.json +++ b/LunaTranslator/files/lang/de.json @@ -846,5 +846,6 @@ "单词": "Wort", "成功添加后关闭窗口": "Fenster nach erfolgreichem Hinzufügen schließen", "绑定窗口": "Fenster binden", - "(点击自己取消)": "(Klicken Sie, um selbst abzubrechen)" + "(点击自己取消)": "(Klicken Sie, um selbst abzubrechen)", + "启动程序": "Programm starten" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/en.json b/LunaTranslator/files/lang/en.json index c581a5ae..5d1ba7aa 100644 --- a/LunaTranslator/files/lang/en.json +++ b/LunaTranslator/files/lang/en.json @@ -846,5 +846,6 @@ "单词": "word", "成功添加后关闭窗口": "Close the window after successful addition", "绑定窗口": "Bind Window", - "(点击自己取消)": "(Click to cancel by yourself)" + "(点击自己取消)": "(Click to cancel by yourself)", + "启动程序": "Start the program" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/es.json b/LunaTranslator/files/lang/es.json index 10dd851f..ef6f4e58 100644 --- a/LunaTranslator/files/lang/es.json +++ b/LunaTranslator/files/lang/es.json @@ -846,5 +846,6 @@ "单词": "Palabras", "成功添加后关闭窗口": "Cerrar la ventana después de agregar con éxito", "绑定窗口": "Ventana vinculada", - "(点击自己取消)": "(haga clic para cancelar por sí mismo)" + "(点击自己取消)": "(haga clic para cancelar por sí mismo)", + "启动程序": "Iniciar el programa" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/fr.json b/LunaTranslator/files/lang/fr.json index aeba6f24..9975040e 100644 --- a/LunaTranslator/files/lang/fr.json +++ b/LunaTranslator/files/lang/fr.json @@ -846,5 +846,6 @@ "单词": "Mots", "成功添加后关闭窗口": "Fermer la fenêtre après un ajout réussi", "绑定窗口": "Fenêtre de liaison", - "(点击自己取消)": "(cliquez vous - même pour annuler)" + "(点击自己取消)": "(cliquez vous - même pour annuler)", + "启动程序": "Lancer le programme" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/it.json b/LunaTranslator/files/lang/it.json index 2762011b..ae305466 100644 --- a/LunaTranslator/files/lang/it.json +++ b/LunaTranslator/files/lang/it.json @@ -846,5 +846,6 @@ "单词": "parola", "成功添加后关闭窗口": "Chiudere la finestra dopo l'aggiunta riuscita", "绑定窗口": "Associa finestra", - "(点击自己取消)": "(Clicca per annullare da solo)" + "(点击自己取消)": "(Clicca per annullare da solo)", + "启动程序": "Avvia il programma" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ja.json b/LunaTranslator/files/lang/ja.json index 426b8636..65d902e3 100644 --- a/LunaTranslator/files/lang/ja.json +++ b/LunaTranslator/files/lang/ja.json @@ -846,5 +846,6 @@ "单词": "単語", "成功添加后关闭窗口": "追加に成功したらウィンドウを閉じる", "绑定窗口": "「バインド」ウィンドウ", - "(点击自己取消)": "(自分でキャンセルするをクリック)" + "(点击自己取消)": "(自分でキャンセルするをクリック)", + "启动程序": "スタートアッププログラム" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ko.json b/LunaTranslator/files/lang/ko.json index 9894a514..a1c216dd 100644 --- a/LunaTranslator/files/lang/ko.json +++ b/LunaTranslator/files/lang/ko.json @@ -846,5 +846,6 @@ "单词": "단어", "成功添加后关闭窗口": "성공적으로 추가한 후 창 닫기", "绑定窗口": "바인딩 창", - "(点击自己取消)": "(자체 취소 클릭)" + "(点击自己取消)": "(자체 취소 클릭)", + "启动程序": "프로그램 시작" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/nl.json b/LunaTranslator/files/lang/nl.json index 58de441d..c1ad3637 100644 --- a/LunaTranslator/files/lang/nl.json +++ b/LunaTranslator/files/lang/nl.json @@ -846,5 +846,6 @@ "单词": "woord", "成功添加后关闭窗口": "Sluit het venster na succesvolle toevoeging", "绑定窗口": "Venster binden", - "(点击自己取消)": "(Klik om zelf te annuleren)" + "(点击自己取消)": "(Klik om zelf te annuleren)", + "启动程序": "Start het programma" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pl.json b/LunaTranslator/files/lang/pl.json index 7b141e50..60cb83d1 100644 --- a/LunaTranslator/files/lang/pl.json +++ b/LunaTranslator/files/lang/pl.json @@ -846,5 +846,6 @@ "单词": "słowo", "成功添加后关闭窗口": "Zamknij okno po pomyślnym dodaniu", "绑定窗口": "Wiąż okno", - "(点击自己取消)": "(Kliknij, aby anulować samodzielnie)" + "(点击自己取消)": "(Kliknij, aby anulować samodzielnie)", + "启动程序": "Uruchom program" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/pt.json b/LunaTranslator/files/lang/pt.json index fffcd281..cce8d693 100644 --- a/LunaTranslator/files/lang/pt.json +++ b/LunaTranslator/files/lang/pt.json @@ -846,5 +846,6 @@ "单词": "palavra", "成功添加后关闭窗口": "Fechar a janela após a adição bem sucedida", "绑定窗口": "Janela Vincular", - "(点击自己取消)": "(Clique para cancelar por si mesmo)" + "(点击自己取消)": "(Clique para cancelar por si mesmo)", + "启动程序": "Iniciar o programa" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/ru.json b/LunaTranslator/files/lang/ru.json index ab900adf..fdef2d49 100644 --- a/LunaTranslator/files/lang/ru.json +++ b/LunaTranslator/files/lang/ru.json @@ -846,5 +846,6 @@ "单词": "Слова", "成功添加后关闭窗口": "Закрыть окно после успешного добавления", "绑定窗口": "Связанное окно", - "(点击自己取消)": "(Нажмите сами, чтобы отменить)" + "(点击自己取消)": "(Нажмите сами, чтобы отменить)", + "启动程序": "Запуск программы" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/sv.json b/LunaTranslator/files/lang/sv.json index e7160cb2..a65ea42a 100644 --- a/LunaTranslator/files/lang/sv.json +++ b/LunaTranslator/files/lang/sv.json @@ -846,5 +846,6 @@ "单词": "ord", "成功添加后关闭窗口": "Stäng fönstret efter lyckat tillägg", "绑定窗口": "Bind fönster", - "(点击自己取消)": "(Klicka för att avbryta själv)" + "(点击自己取消)": "(Klicka för att avbryta själv)", + "启动程序": "Starta programmet" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/th.json b/LunaTranslator/files/lang/th.json index 01f04bae..47a9f3f5 100644 --- a/LunaTranslator/files/lang/th.json +++ b/LunaTranslator/files/lang/th.json @@ -846,5 +846,6 @@ "单词": "คำศัพท์", "成功添加后关闭窗口": "ปิดหน้าต่างหลังจากเพิ่มเรียบร้อยแล้ว", "绑定窗口": "หน้าต่างที่ถูกผูกไว้", - "(点击自己取消)": "(คลิกเพื่อยกเลิกด้วยตัวเอง)" + "(点击自己取消)": "(คลิกเพื่อยกเลิกด้วยตัวเอง)", + "启动程序": "เริ่มโปรแกรม" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/tr.json b/LunaTranslator/files/lang/tr.json index f6fa0bf0..2335544e 100644 --- a/LunaTranslator/files/lang/tr.json +++ b/LunaTranslator/files/lang/tr.json @@ -846,5 +846,6 @@ "单词": "kelime", "成功添加后关闭窗口": "Başarılı eklendikten sonra pencereyi kapat", "绑定窗口": "Bağlam Penceresi", - "(点击自己取消)": "(Kendin iptal etmek için tıklayın)" + "(点击自己取消)": "(Kendin iptal etmek için tıklayın)", + "启动程序": "Programı başlat" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/uk.json b/LunaTranslator/files/lang/uk.json index f0e5ba8e..7ef1fba9 100644 --- a/LunaTranslator/files/lang/uk.json +++ b/LunaTranslator/files/lang/uk.json @@ -846,5 +846,6 @@ "单词": "слово", "成功添加后关闭窗口": "Закрити вікно після успішного додавання", "绑定窗口": "В’ єднати вікно", - "(点击自己取消)": "(Натисніть, щоб скасувати самостійно)" + "(点击自己取消)": "(Натисніть, щоб скасувати самостійно)", + "启动程序": "Запустити програму" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/vi.json b/LunaTranslator/files/lang/vi.json index aaa136d0..94c62ac3 100644 --- a/LunaTranslator/files/lang/vi.json +++ b/LunaTranslator/files/lang/vi.json @@ -846,5 +846,6 @@ "单词": "Từ", "成功添加后关闭窗口": "Đóng cửa sổ sau khi thêm thành công", "绑定窗口": "Cửa sổ bị ràng buộc", - "(点击自己取消)": "(Click vào tự hủy)" + "(点击自己取消)": "(Click vào tự hủy)", + "启动程序": "Khởi chạy chương trình" } \ No newline at end of file diff --git a/LunaTranslator/files/lang/zh.json b/LunaTranslator/files/lang/zh.json index 9922c2c9..c0f89805 100644 --- a/LunaTranslator/files/lang/zh.json +++ b/LunaTranslator/files/lang/zh.json @@ -846,5 +846,6 @@ "单词": "", "成功添加后关闭窗口": "", "绑定窗口": "", - "(点击自己取消)": "" + "(点击自己取消)": "", + "启动程序": "" } \ No newline at end of file diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 99b3f7a5..36225db2 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -28,8 +28,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/version) include(generate_product_version) set(VERSION_MAJOR 5) -set(VERSION_MINOR 31) -set(VERSION_PATCH 5) +set(VERSION_MINOR 32) +set(VERSION_PATCH 0) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)