This commit is contained in:
恍兮惚兮 2024-07-10 22:29:25 +08:00
parent 0ec763c167
commit 484fbe126e
24 changed files with 112 additions and 86 deletions

View File

@ -3,7 +3,7 @@ import platform, functools, sys
import winsharedutils, queue
from myutils.config import globalconfig, _TR, static_data, _TRL
from myutils.wrapper import threader, tryprint
from myutils.utils import makehtml
from myutils.utils import makehtml, dynamiclink
import requests, time
import shutil, gobject
from myutils.proxy import getproxy
@ -22,7 +22,7 @@ versionchecktask = queue.Queue()
def getvesionmethod():
try:
res = requests.get(
"https://lunatranslator.xyz/version",
dynamiclink("{main_server}/version"),
verify=False,
# proxies=getproxy(("github", "versioncheck")),
)
@ -182,10 +182,10 @@ def createdownloadprogress(self):
def wraplink(text: str):
link = "https://lunatranslator.xyz/Github/LunaTranslator/releases"
link = "{main_server}/Github/LunaTranslator/releases"
if text.startswith("v"):
link = f"https://lunatranslator.xyz/Github/LunaTranslator/releases/tag/{text}"
link = "{main_server}/Github/LunaTranslator/releases/tag/" + text
return makehtml(
link,
show=text,
@ -220,7 +220,6 @@ def versionlabelmaybesettext(self, x):
def solvelinkitems(grid, source):
name = source["name"]
link = source["link"]
if link[-8:] == "releases":
__ = False
elif link[-1] == "/":
@ -308,17 +307,17 @@ def setTab_update(self, basel):
]
shuominggrid = [
["项目网站", makehtml("https://lunatranslator.xyz/")],
["项目网站", makehtml("{main_server}/")],
[
"使用说明",
makehtml("https://docs.lunatranslator.xyz/"),
makehtml("{docs_server}/"),
],
]
if globalconfig["languageuse"] == 0:
shuominggrid += [
[
"交流群",
makehtml("https://qm.qq.com/q/qE32v9NYBO", show=912525396),
makehtml("{main_server}/Resource/QQGroup", show=912525396),
],
[],
["如果你感觉该软件对你有帮助,欢迎微信扫码赞助,谢谢~"],

View File

@ -4,6 +4,7 @@ import gobject, os, zipfile, shutil
from myutils.config import globalconfig, _TRL, _TR, static_data
from gui.inputdialog import multicolorset, autoinitdialog
from myutils.wrapper import tryprint
from myutils.utils import dynamiclink
from gui.usefulwidget import (
D_getsimplecombobox,
getsimplecombobox,
@ -210,8 +211,8 @@ def on_not_find_qweb(self):
def _okcallback():
link = [
"https://lunatranslator.xyz/Resource/QWebEngine_x86.zip",
"https://lunatranslator.xyz/Resource/QWebEngine_x64.zip",
dynamiclink("{main_server}/Resource/QWebEngine_x86.zip"),
dynamiclink("{main_server}/Resource/QWebEngine_x64.zip"),
][platform.architecture()[0] == "64bit"]
os.startfile(link)
installqwebdialog(self, link)
@ -315,7 +316,7 @@ def vistranslate_rank(self):
_TR("显示顺序"),
globalconfig["fix_translate_rank_rank"],
isrankeditor=True,
namemapfunction=lambda k:globalconfig['fanyi'][k]["name"]
namemapfunction=lambda k: globalconfig["fanyi"][k]["name"],
)

View File

@ -56,7 +56,7 @@ def gethookgrid(self):
[
(
makehtml(
"https://lunatranslator.xyz/Resource/game_support",
"{main_server}/Resource/game_support",
show=_TR("不支持的游戏?"),
),
0,

View File

@ -488,7 +488,14 @@ def minmaxmoveobservefunc(self):
_()
def dynamiclink(text):
return text.format(
main_server=static_data["main_server"], docs_server=static_data["docs_server"]
)
def makehtml(text, base=False, show=None):
text = dynamiclink(text)
if base:
show = text.split("/")[-1]
elif show:
@ -508,6 +515,7 @@ class autosql(sqlite3.Connection):
def __del__(self):
self.close()
@tryprint
def parsemayberegexreplace(dict, res):
for item in dict:

View File

@ -1080,8 +1080,8 @@
"args": {
"Port": 23456,
"preset": "",
"整合包_CPU": "https://lunatranslator.xyz/Resource/IntegrationPack/vits-simple-api/cpu",
"整合包_GPU": "https://lunatranslator.xyz/Resource/IntegrationPack/vits-simple-api/gpu"
"整合包_CPU": "{main_server}/Resource/IntegrationPack/vits-simple-api/cpu",
"整合包_GPU": "{main_server}/Resource/IntegrationPack/vits-simple-api/gpu"
},
"argstype": {
"Port": {

View File

@ -246,8 +246,8 @@
"mangaocr": {
"args": {
"项目仓库": "https://github.com/kha-white/manga-ocr",
"整合包_CPU_1": "https://lunatranslator.xyz/Resource/IntegrationPack/manga_ocr/cpu",
"整合包_GPU_1": "https://lunatranslator.xyz/Resource/IntegrationPack/manga_ocr/gpu",
"整合包_CPU_1": "{main_server}/Resource/IntegrationPack/manga_ocr/cpu",
"整合包_GPU_1": "{main_server}/Resource/IntegrationPack/manga_ocr/gpu",
"Port": 5665
},
"argstype": {

View File

@ -680,21 +680,21 @@
"links": [
{
"name": "J北京7",
"link": "https://lunatranslator.xyz/Resource/translate/JBeijing7.zip"
"link": "{main_server}/Resource/translate/JBeijing7.zip"
},
{
"name": "用户词典",
"link": "https://lunatranslator.xyz/Resource/translate/JBeijing7UserDict.zip"
"link": "{main_server}/Resource/translate/JBeijing7UserDict.zip"
}
]
},
{
"name": "金山快译",
"link": "https://lunatranslator.xyz/Resource/translate/FastAIT09_Setup.25269.4101.zip"
"link": "{main_server}/Resource/translate/FastAIT09_Setup.25269.4101.zip"
},
{
"name": "快译通",
"link": "https://lunatranslator.xyz/Resource/translate/DR.eye.zip"
"link": "{main_server}/Resource/translate/DR.eye.zip"
},
{
"name": "MT5",
@ -702,7 +702,7 @@
},
{
"name": "Sugoi",
"link": "https://lunatranslator.xyz/Resource/translate/Sugoi_Translator_V8.7z"
"link": "{main_server}/Resource/translate/Sugoi_Translator_V8.7z"
},
{
"name": "Sakura大模型",
@ -723,27 +723,27 @@
"links": [
{
"name": "日语",
"link": "https://lunatranslator.xyz/Resource/ocr_models/ja.zip"
"link": "{main_server}/Resource/ocr_models/ja.zip"
},
{
"name": "英文",
"link": "https://lunatranslator.xyz/Resource/ocr_models/en.zip"
"link": "{main_server}/Resource/ocr_models/en.zip"
},
{
"name": "简体中文",
"link": "https://lunatranslator.xyz/Resource/ocr_models/zh.zip"
"link": "{main_server}/Resource/ocr_models/zh.zip"
},
{
"name": "繁体中文",
"link": "https://lunatranslator.xyz/Resource/ocr_models/cht.zip"
"link": "{main_server}/Resource/ocr_models/cht.zip"
},
{
"name": "韩语",
"link": "https://lunatranslator.xyz/Resource/ocr_models/ko.zip"
"link": "{main_server}/Resource/ocr_models/ko.zip"
},
{
"name": "俄语",
"link": "https://lunatranslator.xyz/Resource/ocr_models/ru.zip"
"link": "{main_server}/Resource/ocr_models/ru.zip"
}
]
},
@ -757,11 +757,11 @@
},
{
"name": "整合包_CPU",
"link": "https://lunatranslator.xyz/Resource/IntegrationPack/manga_ocr/cpu"
"link": "{main_server}/Resource/IntegrationPack/manga_ocr/cpu"
},
{
"name": "整合包_GPU",
"link": "https://lunatranslator.xyz/Resource/IntegrationPack/manga_ocr/gpu"
"link": "{main_server}/Resource/IntegrationPack/manga_ocr/gpu"
}
]
}
@ -776,7 +776,7 @@
"links": [
{
"name": "MeCab",
"link": "https://lunatranslator.xyz/Resource/dictionary/Mecab.zip"
"link": "{main_server}/Resource/dictionary/Mecab.zip"
},
{
"name": "Unidic",
@ -786,19 +786,19 @@
},
{
"name": "小学馆",
"link": "https://lunatranslator.xyz/Resource/dictionary/xiaoxueguan.db"
"link": "{main_server}/Resource/dictionary/xiaoxueguan.db"
},
{
"name": "EDICT",
"link": "https://lunatranslator.xyz/Resource/dictionary/edict.db"
"link": "{main_server}/Resource/dictionary/edict.db"
},
{
"name": "EDICT2",
"link": "https://lunatranslator.xyz/Resource/dictionary/edict2"
"link": "{main_server}/Resource/dictionary/edict2"
},
{
"name": "灵格斯词典",
"link": "https://lunatranslator.xyz/Resource/dictionary/Lingoes.zip"
"link": "{main_server}/Resource/dictionary/Lingoes.zip"
},
{
"name": "MDict",
@ -825,11 +825,11 @@
"links": [
{
"name": "Misaki",
"link": "https://lunatranslator.xyz/Resource/voice/NeoSpeech.Japanese.Misaki.zip"
"link": "{main_server}/Resource/voice/NeoSpeech.Japanese.Misaki.zip"
},
{
"name": "Show",
"link": "https://lunatranslator.xyz/Resource/voice/NeoSpeech.TTS.NeoSpeech.Japanese.Show_v3.10.0.0.zip"
"link": "{main_server}/Resource/voice/NeoSpeech.TTS.NeoSpeech.Japanese.Show_v3.10.0.0.zip"
}
]
},
@ -847,17 +847,17 @@
},
{
"name": "整合包_CPU",
"link": "https://lunatranslator.xyz/Resource/IntegrationPack/vits-simple-api/cpu"
"link": "{main_server}/Resource/IntegrationPack/vits-simple-api/cpu"
},
{
"name": "整合包_GPU",
"link": "https://lunatranslator.xyz/Resource/IntegrationPack/vits-simple-api/gpu"
"link": "{main_server}/Resource/IntegrationPack/vits-simple-api/gpu"
}
]
},
{
"name": "VoiceRoid+_東北ずん子/东北俊子",
"link": "https://lunatranslator.xyz/Resource/voice/VOICEROID+zunko.7z"
"link": "{main_server}/Resource/voice/VOICEROID+zunko.7z"
},
{
"name": "VoiceRoid2",
@ -865,107 +865,107 @@
"links": [
{
"name": "SFE_結月ゆかり/结月缘",
"link": "https://lunatranslator.xyz/Resource/voice/Yukari2.zip"
"link": "{main_server}/Resource/voice/Yukari2.zip"
},
{
"name": "結月ゆかり/结月缘",
"link": "https://lunatranslator.xyz/Resource/voice/VOICEROID2_Yuzuki_Yukari.zip"
"link": "{main_server}/Resource/voice/VOICEROID2_Yuzuki_Yukari.zip"
},
{
"name": "紲星あかり/绁星灯",
"link": "https://lunatranslator.xyz/Resource/voice/VOICEROID2_Kizuna_Akari.zip"
"link": "{main_server}/Resource/voice/VOICEROID2_Kizuna_Akari.zip"
},
{
"name": "琴葉 茜・葵",
"link": "https://lunatranslator.xyz/Resource/voice/VOICEROID2_Kotonoha_Akane_Aoi.zip"
"link": "{main_server}/Resource/voice/VOICEROID2_Kotonoha_Akane_Aoi.zip"
},
{
"name": "伊織弓鶴",
"link": "https://lunatranslator.xyz/Resource/voice/VOICEROID2_Iori_Yuzuru.zip"
"link": "{main_server}/Resource/voice/VOICEROID2_Iori_Yuzuru.zip"
},
{
"name": "ついなちゃん",
"link": "https://lunatranslator.xyz/Resource/voice/VOICEROID2_tsuina-chan_dl_e.zip"
"link": "{main_server}/Resource/voice/VOICEROID2_tsuina-chan_dl_e.zip"
},
{
"name": "東北イタコ/东北伊达子",
"link": "https://lunatranslator.xyz/Resource/voice/VOICEROID2_Tohoku_Itako.zip"
"link": "{main_server}/Resource/voice/VOICEROID2_Tohoku_Itako.zip"
},
{
"name": "附加音源_結月ゆかり",
"link": "https://lunatranslator.xyz/Resource/voice/yukari_emo_44.zip"
"link": "{main_server}/Resource/voice/yukari_emo_44.zip"
},
{
"name": "附加音源_紲星あかり",
"link": "https://lunatranslator.xyz/Resource/voice/akari_44.zip"
"link": "{main_server}/Resource/voice/akari_44.zip"
},
{
"name": "附加音源_東北きりたん",
"link": "https://lunatranslator.xyz/Resource/voice/kiritan_44.zip"
"link": "{main_server}/Resource/voice/kiritan_44.zip"
},
{
"name": "附加音源_東北イタコ",
"link": "https://lunatranslator.xyz/Resource/voice/itako_emo_44.zip"
"link": "{main_server}/Resource/voice/itako_emo_44.zip"
},
{
"name": "附加音源_東北ずん子",
"link": "https://lunatranslator.xyz/Resource/voice/zunko_44.zip"
"link": "{main_server}/Resource/voice/zunko_44.zip"
},
{
"name": "附加音源_伊織弓鶴",
"link": "https://lunatranslator.xyz/Resource/voice/yuzuru_emo_44.zip"
"link": "{main_server}/Resource/voice/yuzuru_emo_44.zip"
},
{
"name": "附加音源_ついなちゃん",
"link": "https://lunatranslator.xyz/Resource/voice/tsuina_44.zip"
"link": "{main_server}/Resource/voice/tsuina_44.zip"
},
{
"name": "附加音源_ついなちゃん関西弁",
"link": "https://lunatranslator.xyz/Resource/voice/tsuina_west_44.zip"
"link": "{main_server}/Resource/voice/tsuina_west_44.zip"
},
{
"name": "附加音源_琴葉茜",
"link": "https://lunatranslator.xyz/Resource/voice/akane_west_emo_44.zip"
"link": "{main_server}/Resource/voice/akane_west_emo_44.zip"
},
{
"name": "附加音源_琴葉葵",
"link": "https://lunatranslator.xyz/Resource/voice/aoi_emo_44.zip"
"link": "{main_server}/Resource/voice/aoi_emo_44.zip"
},
{
"name": "附加音源_水奈瀬コウ",
"link": "https://lunatranslator.xyz/Resource/voice/kou_44.zip"
"link": "{main_server}/Resource/voice/kou_44.zip"
},
{
"name": "附加音源_桜乃そら",
"link": "https://lunatranslator.xyz/Resource/voice/sora_44.zip"
"link": "{main_server}/Resource/voice/sora_44.zip"
},
{
"name": "附加音源_民安ともえ",
"link": "https://lunatranslator.xyz/Resource/voice/tamiyasu_44.zip"
"link": "{main_server}/Resource/voice/tamiyasu_44.zip"
},
{
"name": "附加音源_月読アイ",
"link": "https://lunatranslator.xyz/Resource/voice/ai_44.zip"
"link": "{main_server}/Resource/voice/ai_44.zip"
},
{
"name": "附加音源_月読ショウタ",
"link": "https://lunatranslator.xyz/Resource/voice/shouta_44.zip"
"link": "{main_server}/Resource/voice/shouta_44.zip"
},
{
"name": "附加音源_京町セイカ",
"link": "https://lunatranslator.xyz/Resource/voice/seika_44.zip"
"link": "{main_server}/Resource/voice/seika_44.zip"
},
{
"name": "附加音源_音街ウナ",
"link": "https://lunatranslator.xyz/Resource/voice/una_44.zip"
"link": "{main_server}/Resource/voice/una_44.zip"
},
{
"name": "附加音源_鷹の爪吉田",
"link": "https://lunatranslator.xyz/Resource/voice/yoshidakun_44.zip"
"link": "{main_server}/Resource/voice/yoshidakun_44.zip"
},
{
"name": "附加音源_ギャラ子",
"link": "https://lunatranslator.xyz/Resource/voice/galaco_44.zip"
"link": "{main_server}/Resource/voice/galaco_44.zip"
}
]
}
@ -1001,7 +1001,7 @@
},
{
"name": "win7适配版",
"link": "https://lunatranslator.xyz/Resource/Magpie9_Win7"
"link": "{main_server}/Resource/Magpie9_Win7"
}
]
},
@ -1011,11 +1011,11 @@
"links": [
{
"name": "x86",
"link": "https://lunatranslator.xyz/Resource/QWebEngine_x86.zip"
"link": "{main_server}/Resource/QWebEngine_x86.zip"
},
{
"name": "x64",
"link": "https://lunatranslator.xyz/Resource/QWebEngine_x64.zip"
"link": "{main_server}/Resource/QWebEngine_x64.zip"
}
]
}
@ -1763,5 +1763,7 @@
"audioengine_vis": [
"Windows MCI",
"miniaudio"
]
],
"main_server": "https://lunatranslator.xyz",
"docs_server": "https://docs.lunatranslator.xyz"
}

View File

@ -91,7 +91,8 @@
},
"sugoix": {
"args": {
"api": "http://127.0.0.1:14366/"
"api": "http://127.0.0.1:14366/",
"V8": "{main_server}/Resource/translate/Sugoi_Translator_V8.7z"
},
"argstype": {
"V8": {

View File

@ -814,5 +814,6 @@
"语速": "سرعة الكلام",
"音量": "حجم",
"固定翻译显示顺序": "ترجمة ثابتة عرض تسلسل",
"显示顺序": "عرض تسلسل"
"显示顺序": "عرض تسلسل",
"安装": "تركيب ."
}

View File

@ -814,5 +814,6 @@
"语速": "語速",
"音量": "音量",
"固定翻译显示顺序": "固定翻譯顯示順序",
"显示顺序": "顯示順序"
"显示顺序": "顯示順序",
"安装": "安裝"
}

View File

@ -814,5 +814,6 @@
"语速": "Speech Speed",
"音量": "Volume",
"固定翻译显示顺序": "Fixed translation display order",
"显示顺序": "Display order"
"显示顺序": "Display order",
"安装": "install"
}

View File

@ -814,5 +814,6 @@
"语速": "Velocidad del habla",
"音量": "Volumen",
"固定翻译显示顺序": "Orden fijo de visualización de la traducción",
"显示顺序": "Orden de visualización"
"显示顺序": "Orden de visualización",
"安装": "Instalación"
}

View File

@ -814,5 +814,6 @@
"语速": "Vitesse de la parole",
"音量": "Volume",
"固定翻译显示顺序": "Ordre fixe d'affichage de la traduction",
"显示顺序": "Ordre d'affichage"
"显示顺序": "Ordre d'affichage",
"安装": "Installation"
}

View File

@ -814,5 +814,6 @@
"语速": "Velocità vocale",
"音量": "volume",
"固定翻译显示顺序": "Ordine fisso di visualizzazione della traduzione",
"显示顺序": "Ordine di visualizzazione"
"显示顺序": "Ordine di visualizzazione",
"安装": "installa"
}

View File

@ -814,5 +814,6 @@
"语速": "早口",
"音量": "音量",
"固定翻译显示顺序": "固定翻訳表示順序",
"显示顺序": "表示順序"
"显示顺序": "表示順序",
"安装": "インストール"
}

View File

@ -814,5 +814,6 @@
"语速": "말속도",
"音量": "볼륨",
"固定翻译显示顺序": "고정 번역 표시 순서",
"显示顺序": "표시 순서"
"显示顺序": "표시 순서",
"安装": "설치"
}

View File

@ -814,5 +814,6 @@
"语速": "Szybkość mowy",
"音量": "objętość",
"固定翻译显示顺序": "Stała kolejność wyświetlania tłumaczeń",
"显示顺序": "Kolejność wyświetlania"
"显示顺序": "Kolejność wyświetlania",
"安装": "instaluj"
}

View File

@ -814,5 +814,6 @@
"语速": "Скорость речи",
"音量": "Громкость",
"固定翻译显示顺序": "Фиксированный перевод Показать порядок",
"显示顺序": "Показать последовательность"
"显示顺序": "Показать последовательность",
"安装": "Монтаж"
}

View File

@ -814,5 +814,6 @@
"语速": "ความเร็วการพูด",
"音量": "ระดับเสียง",
"固定翻译显示顺序": "ลำดับการแสดงผลการแปลคงที่",
"显示顺序": "แสดงลำดับ"
"显示顺序": "แสดงลำดับ",
"安装": "การติดตั้ง"
}

View File

@ -814,5 +814,6 @@
"语速": "Konuşma hızı",
"音量": "volume",
"固定翻译显示顺序": "Fikir çeviri gösterme düzeni",
"显示顺序": "Gösterim düzeni"
"显示顺序": "Gösterim düzeni",
"安装": "Kur"
}

View File

@ -814,5 +814,6 @@
"语速": "Швидкість мовлення",
"音量": "гучність",
"固定翻译显示顺序": "Визначений порядок показу перекладу",
"显示顺序": "Порядок показу"
"显示顺序": "Порядок показу",
"安装": "встановити"
}

View File

@ -814,5 +814,6 @@
"语速": "Tốc độ nói",
"音量": "Âm lượng",
"固定翻译显示顺序": "Trình tự hiển thị bản dịch cố định",
"显示顺序": "Thứ tự hiển thị"
"显示顺序": "Thứ tự hiển thị",
"安装": "Cài đặt"
}

View File

@ -814,5 +814,6 @@
"语速": "",
"音量": "",
"固定翻译显示顺序": "",
"显示顺序": ""
"显示顺序": "",
"安装": ""
}

View File

@ -9,7 +9,7 @@
> **一款galgame翻译器**
### <a href="https://lunatranslator.xyz/#/zh/" target="_blank">使用说明</a> <a href="https://space.bilibili.com/592120404/video" target="_blank">视频教程</a> [交流群912525396](https://qm.qq.com/q/qE32v9NYBO)
### <a href="https://lunatranslator.xyz/#/zh/" target="_blank">使用说明</a> <a href="https://space.bilibili.com/592120404/video" target="_blank">视频教程</a> [交流群912525396](https://lunatranslator.xyz/Resource/QQGroup)
## 功能支持