mirror of
https://github.com/HIllya51/LunaTranslator.git
synced 2025-01-14 16:33:54 +08:00
some
This commit is contained in:
parent
222c0c56d0
commit
86703a520a
@ -99,3 +99,4 @@
|
||||
#define PROC_DISCONN L"處理程序已中斷連接 %d"
|
||||
#define COPYSELECTION L"自動將文字框中選取的文字複製到剪貼簿"
|
||||
#define FONTSELECT L"選擇字體"
|
||||
#define UNMATCHABLEVERSION L"LunaHook和LunaHost版本不匹配,可能無法正常工作!"
|
@ -99,3 +99,4 @@
|
||||
#define PROC_DISCONN L"process disconnected %d"
|
||||
#define COPYSELECTION L"auto send selected text in textbox to clipboard"
|
||||
#define FONTSELECT L"Select Font"
|
||||
#define UNMATCHABLEVERSION L"LunaHook and LunaHost versions do not match, may not work properly!"
|
@ -99,3 +99,4 @@
|
||||
#define PROC_DISCONN L"Процесс отключен %d"
|
||||
#define COPYSELECTION L"Автоматически копировать выделенный текст в буфер обмена"
|
||||
#define FONTSELECT L"Выбрать шрифт"
|
||||
#define UNMATCHABLEVERSION L"Версии LunaHook и LunaHost не совпадают и могут не работать должным образом!"
|
@ -99,3 +99,4 @@
|
||||
#define PROC_DISCONN L"进程已断开连接 %d"
|
||||
#define COPYSELECTION L"自动将文本框中选取的文本复制到剪贴板"
|
||||
#define FONTSELECT L"选择字体"
|
||||
#define UNMATCHABLEVERSION L"LunaHook和LunaHost版本无法匹配,可能无法正常工作!"
|
@ -34,6 +34,8 @@ DWORD WINAPI Pipe(LPVOID)
|
||||
|
||||
*(DWORD *)buffer = GetCurrentProcessId();
|
||||
WriteFile(hookPipe, buffer, sizeof(DWORD), &count, nullptr);
|
||||
WORD hookversion[4]=LUNA_VERSION;
|
||||
WriteFile(hookPipe, hookversion, sizeof(hookversion), &count, nullptr);
|
||||
|
||||
ConsoleOutput(PIPE_CONNECTED);
|
||||
HIJACK();
|
||||
|
@ -3,7 +3,7 @@ if(BUILD_GUI)
|
||||
add_executable(LunaHost WIN32 confighelper.cpp controls.cpp main.cpp processlistwindow.cpp LunaHost.cpp window.cpp luna.rc pluginmanager.cpp Plugin/extensionimpl.cpp Plugin/copyclipboard.cpp QtLoader_inline.cpp app.manifest ${versioninfohost})
|
||||
target_precompile_headers(LunaHost REUSE_FROM pch)
|
||||
set_target_properties(LunaHost PROPERTIES OUTPUT_NAME "LunaHost${bitappendix}")
|
||||
target_link_libraries(LunaHost comctl32 winhttp version pch host ${YY_Thunks_for_WinXP} nlohmann)
|
||||
target_link_libraries(LunaHost comctl32 winhttp pch host ${YY_Thunks_for_WinXP} nlohmann)
|
||||
endif()
|
||||
|
||||
if(BUILD_PLUGIN)
|
||||
|
@ -139,44 +139,6 @@ void LunaHost::on_proc_connect(DWORD pid)
|
||||
}
|
||||
}
|
||||
|
||||
bool queryversion(WORD *_1, WORD *_2, WORD *_3, WORD *_4)
|
||||
{
|
||||
wchar_t fileName[MAX_PATH];
|
||||
GetModuleFileNameW(NULL, fileName, MAX_PATH);
|
||||
DWORD dwHandle;
|
||||
DWORD dwSize = GetFileVersionInfoSizeW(fileName, &dwHandle);
|
||||
if (dwSize == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::vector<char> versionInfoBuffer(dwSize);
|
||||
if (!GetFileVersionInfoW(fileName, dwHandle, dwSize, versionInfoBuffer.data()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
VS_FIXEDFILEINFO *pFileInfo;
|
||||
UINT fileInfoSize;
|
||||
if (!VerQueryValueW(versionInfoBuffer.data(), L"\\", reinterpret_cast<LPVOID *>(&pFileInfo), &fileInfoSize))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
DWORD ms = pFileInfo->dwFileVersionMS;
|
||||
DWORD ls = pFileInfo->dwFileVersionLS;
|
||||
|
||||
WORD majorVersion = HIWORD(ms);
|
||||
WORD minorVersion = LOWORD(ms);
|
||||
WORD buildNumber = HIWORD(ls);
|
||||
WORD revisionNumber = LOWORD(ls);
|
||||
*_1 = majorVersion;
|
||||
*_2 = minorVersion;
|
||||
*_3 = buildNumber;
|
||||
*_4 = revisionNumber;
|
||||
return true;
|
||||
}
|
||||
|
||||
LunaHost::LunaHost()
|
||||
{
|
||||
|
||||
@ -348,11 +310,11 @@ LunaHost::LunaHost()
|
||||
} })
|
||||
.detach();
|
||||
|
||||
WORD _1, _2, _3, _4;
|
||||
WORD version[4] = LUNA_VERSION;
|
||||
WCHAR vs[32];
|
||||
if (queryversion(&_1, &_2, &_3, &_4))
|
||||
{
|
||||
wsprintf(vs, L" | %s v%d.%d.%d", VersionCurrent, _1, _2, _3);
|
||||
wsprintf(vs, L" | %s v%d.%d.%d", VersionCurrent, version[0], version[1], version[2]);
|
||||
title += vs;
|
||||
settext(title);
|
||||
std::thread([&]()
|
||||
|
@ -101,6 +101,12 @@ namespace
|
||||
OnConnect(processId);
|
||||
Host::AddConsoleOutput(FormatString(PROC_CONN,processId));
|
||||
//CreatePipe();
|
||||
WORD hookversion[4];
|
||||
WORD hostversion[4]=LUNA_VERSION;
|
||||
if( ReadFile(hookPipe, hookversion, sizeof(hookversion), &bytesRead, nullptr)){
|
||||
if(memcmp(hostversion,hookversion,sizeof(hookversion))!=0)
|
||||
Host::Warning(UNMATCHABLEVERSION);
|
||||
}
|
||||
|
||||
while (ReadFile(hookPipe, buffer, PIPE_BUFFER_SIZE, &bytesRead, nullptr))
|
||||
switch (*(HostNotificationType*)buffer)
|
||||
|
@ -1,8 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// texthook/const.h
|
||||
// 8/23/2013 jichi
|
||||
// Branch: ITH/common.h, rev 128
|
||||
#define LUNA_VERSION {VERSION_MAJOR,VERSION_MINOR,VERSION_PATCH,VERSION_REVISION}
|
||||
|
||||
enum
|
||||
{
|
||||
|
@ -2,5 +2,9 @@
|
||||
set(VERSION_MAJOR 5)
|
||||
set(VERSION_MINOR 56)
|
||||
set(VERSION_PATCH 8)
|
||||
|
||||
set(VERSION_REVISION 0)
|
||||
add_definitions(-DVERSION_MAJOR=${VERSION_MAJOR})
|
||||
add_definitions(-DVERSION_MINOR=${VERSION_MINOR})
|
||||
add_definitions(-DVERSION_PATCH=${VERSION_PATCH})
|
||||
add_definitions(-DVERSION_REVISION=${VERSION_REVISION})
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/version/generate_product_version.cmake)
|
@ -3,7 +3,7 @@ from traceback import print_exc
|
||||
from myutils.proxy import getproxy
|
||||
|
||||
# fmt: off
|
||||
allkata="ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶヽヾ",
|
||||
allkata="ァアィイゥウェエォオカガキギクグケゲコゴサザシジスズセゼソゾタダチヂッツヅテデトドナニヌネノハバパヒビピフブプヘベペホボポマミムメモャヤュユョヨラリルレロヮワヰヱヲンヴヵヶヽヾ"
|
||||
allhira="ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんゔゕゖゝゞ"
|
||||
hira_s=["あ","い","う","え","お","か","き","く","け","こ","さ","し","す","せ","そ","た","ち","つ","て","と","な","に","ぬ","ね","の","は","ひ","ふ","へ","ほ","ま","み","む","め","も","や","ゆ","よ","ら","り","る","れ","ろ","わ","を","ん","が","ぎ","ぐ","げ","ご","ざ","じ","ず","ぜ","ぞ","だ","ぢ","づ","で","ど","ば","び","ぶ","べ","ぼ","ぱ","ぴ","ぷ","ぺ","ぽ","きゃ","きぃ","きゅ","きぇ","きょ","しゃ","しぃ","しゅ","しぇ","しょ","ちゃ","ちぃ","ちゅ","ちぇ","ちょ","にゃ","にぃ","にゅ","にぇ","にょ","ひゃ","ひぃ","ひゅ","ひぇ","ひょ","みゃ","みぃ","みゅ","みぇ","みょ","りゃ","りぃ","りゅ","りぇ","りょ","ぎゃ","ぎぃ","ぎゅ","ぎぇ","ぎょ","じゃ","じぃ","じゅ","じぇ","じょ","ぢゃ","ぢぃ","ぢゅ","ぢぇ","ぢょ","びゃ","びぃ","びゅ","びぇ","びょ","ぴゃ","ぴぃ","ぴゅ","ぴぇ","ぴょ","ぐぁ","ぐぃ","ぐぅ","ぐぇ","ぐぉ","つぁ","つぃ","つぇ","つぉ","ふぁ","ふぃ","ふぇ","ふぉ","うぁ","うぃ","うぅ","うぇ","うぉ","ヴぁ","ヴぃ","ヴ","ヴぇ","ヴぉ","でゃ","でぃ","でゅ","でぇ","でょ","てゃ","てぃ","てゅ","てぇ","てょ","っ"]
|
||||
kata_s=["ア","イ","ウ","エ","オ","カ","キ","ク","ケ","コ","サ","シ","ス","セ","ソ","タ","チ","ツ","テ","ト","ナ","ニ","ヌ","ネ","ノ","ハ","ヒ","フ","ヘ","ホ","マ","ミ","ム","メ","モ","ヤ","ユ","ヨ","ラ","リ","ル","レ","ロ","ワ","ヲ","ン","ガ","ギ","グ","ゲ","ゴ","ザ","ジ","ズ","ゼ","ゾ","ダ","ヂ","ヅ","デ","ド","バ","ビ","ブ","ベ","ボ","パ","ピ","プ","ペ","ポ","キャ","キィ","キュ","キェ","キョ","シャ","シィ","シュ","シェ","ショ","チャ","チィ","チュ","チェ","チョ","ニャ","ニィ","ニュ","ニェ","ニョ","ヒャ","ヒィ","ヒュ","ヒェ","ヒョ","ミャ","ミィ","ミュ","ミェ","ミョ","リャ","リィ","リュ","リェ","リョ","ギャ","ギィ","ギュ","ギェ","ギョ","ジャ","ジィ","ジュ","ジェ","ジョ","ヂャ","ヂィ","ヂュ","ヂェ","ヂョ","ビャ","ビィ","ビュ","ビェ","ビョ","ピャ","ピィ","ピュ","ピェ","ピョ","グァ","グィ","グゥ","グェ","グォ","ツァ","ツィ","ツェ","ツォ","ファ","フィ","フェ","フォ","ウァ","ウィ","ウゥ","ウェ","ウォ","ヴァ","ヴィ","ヴ","ヴェ","ヴォ","デャ","ディ","デュ","デェ","デョ","テャ","ティ","テュ","テェ","テョ","ッ"]
|
||||
|
@ -588,6 +588,7 @@ def _TR(k: str):
|
||||
__ = "(" + __ + ")"
|
||||
if not __:
|
||||
__ = k
|
||||
languageshow[k] = ""
|
||||
return __
|
||||
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
from myutils.subproc import subproc_w, autoproc
|
||||
from translator.basetranslator import basetrans
|
||||
import os, time
|
||||
from myutils.config import _TR
|
||||
import windows
|
||||
|
||||
|
||||
@ -46,7 +47,7 @@ class TS(basetrans):
|
||||
def x64(self, content):
|
||||
|
||||
if self.checkpath() == False:
|
||||
return "error"
|
||||
raise Exception(_TR("翻译器加载失败"))
|
||||
ress = []
|
||||
for line in content.split("\n"):
|
||||
if len(line) == 0:
|
||||
|
@ -1,5 +1,6 @@
|
||||
from myutils.subproc import subproc_w, autoproc
|
||||
from translator.basetranslator import basetrans
|
||||
from myutils.config import _TR
|
||||
import os, time
|
||||
import windows
|
||||
|
||||
@ -61,7 +62,7 @@ class TS(basetrans):
|
||||
def x64(self, content):
|
||||
|
||||
if self.checkpath() == False:
|
||||
return "error"
|
||||
raise Exception(_TR("翻译器加载失败"))
|
||||
codes = {"zh": "gbk", "ja": "shift-jis", "en": "utf8"}
|
||||
ress = []
|
||||
for line in content.split("\n"):
|
||||
|
@ -1,5 +1,5 @@
|
||||
from translator.basetranslator import basetrans
|
||||
import ctypes
|
||||
from myutils.config import _TR
|
||||
import os, time
|
||||
import windows
|
||||
from myutils.subproc import subproc_w, autoproc
|
||||
@ -57,7 +57,7 @@ class TS(basetrans):
|
||||
def x64(self, content: str):
|
||||
|
||||
if self.checkpath() == False:
|
||||
return "error"
|
||||
raise Exception(_TR("翻译器加载失败"))
|
||||
content = content.replace("\r", "\n")
|
||||
|
||||
code1 = content.encode("utf-16-le")
|
||||
|
@ -2,6 +2,7 @@ from translator.basetranslator import basetrans
|
||||
import ctypes
|
||||
import os, time
|
||||
import windows
|
||||
from myutils.config import _TR
|
||||
from myutils.subproc import subproc_w, autoproc
|
||||
|
||||
|
||||
@ -69,9 +70,8 @@ class TS(basetrans):
|
||||
def x64(self, content: str):
|
||||
if self.tgtlang not in ["936", "950"]:
|
||||
return ""
|
||||
t = time.time()
|
||||
if self.checkpath() == False:
|
||||
return "error"
|
||||
raise Exception(_TR("翻译器加载失败"))
|
||||
content = content.replace("\r", "\n")
|
||||
lines = content.split("\n")
|
||||
ress = []
|
||||
|
@ -1,5 +1,6 @@
|
||||
from myutils.subproc import subproc_w, autoproc
|
||||
from translator.basetranslator import basetrans
|
||||
from myutils.config import _TR
|
||||
import os, time
|
||||
import windows
|
||||
|
||||
@ -65,7 +66,7 @@ class TS(basetrans):
|
||||
|
||||
def x64(self, content):
|
||||
if self.checkpath() == False:
|
||||
return "error"
|
||||
raise Exception(_TR("翻译器加载失败"))
|
||||
ress = []
|
||||
for line in content.split("\n"):
|
||||
if len(line) == 0:
|
||||
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "لا توجد لغة متاحة",
|
||||
"过时的词典": "قاموس عفا عليها الزمن",
|
||||
"其他工具": "أدوات أخرى",
|
||||
"过时的翻译器": "عفا عليها الزمن مترجم"
|
||||
"过时的翻译器": "عفا عليها الزمن مترجم",
|
||||
"翻译器加载失败": "المترجم فشل التحميل"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "無可用語言",
|
||||
"过时的词典": "過時的詞典",
|
||||
"其他工具": "其他工具",
|
||||
"过时的翻译器": "過時的翻譯器"
|
||||
"过时的翻译器": "過時的翻譯器",
|
||||
"翻译器加载失败": "翻譯器加載失敗"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Žádné dostupné jazyky",
|
||||
"过时的词典": "Zastaralý slovník",
|
||||
"其他工具": "Ostatní nástroje",
|
||||
"过时的翻译器": "Zastaralý překladatel"
|
||||
"过时的翻译器": "Zastaralý překladatel",
|
||||
"翻译器加载失败": "Načítání překladatele selhalo"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Keine verfügbaren Sprachen",
|
||||
"过时的词典": "Veraltetes Wörterbuch",
|
||||
"其他工具": "Andere Werkzeuge",
|
||||
"过时的翻译器": "Veralteter Übersetzer"
|
||||
"过时的翻译器": "Veralteter Übersetzer",
|
||||
"翻译器加载失败": "Laden des Übersetzers fehlgeschlagen"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "No available languages",
|
||||
"过时的词典": "Outdated dictionary",
|
||||
"其他工具": "Other tools",
|
||||
"过时的翻译器": "Outdated translator"
|
||||
"过时的翻译器": "Outdated translator",
|
||||
"翻译器加载失败": "Translator loading failed"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "No hay idiomas disponibles",
|
||||
"过时的词典": "Diccionarios obsoletos",
|
||||
"其他工具": "Otras herramientas",
|
||||
"过时的翻译器": "Traductores obsoletos"
|
||||
"过时的翻译器": "Traductores obsoletos",
|
||||
"翻译器加载失败": "Falló la carga del traductor"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Aucune langue disponible",
|
||||
"过时的词典": "Dictionnaire obsolète",
|
||||
"其他工具": "Autres outils",
|
||||
"过时的翻译器": "Traducteur obsolète"
|
||||
"过时的翻译器": "Traducteur obsolète",
|
||||
"翻译器加载失败": "Le chargement du traducteur a échoué"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Nessuna lingua disponibile",
|
||||
"过时的词典": "Dizionario obsoleto",
|
||||
"其他工具": "Altri strumenti",
|
||||
"过时的翻译器": "Traduttore obsoleto"
|
||||
"过时的翻译器": "Traduttore obsoleto",
|
||||
"翻译器加载失败": "Caricamento del traduttore non riuscito"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "使用可能な言語はありません",
|
||||
"过时的词典": "時代遅れの辞書",
|
||||
"其他工具": "その他のツール",
|
||||
"过时的翻译器": "古い翻訳機"
|
||||
"过时的翻译器": "古い翻訳機",
|
||||
"翻译器加载失败": "翻訳機のロードに失敗しました"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "사용 가능한 언어 없음",
|
||||
"过时的词典": "구식 사전",
|
||||
"其他工具": "기타 도구",
|
||||
"过时的翻译器": "오래된 번역기"
|
||||
"过时的翻译器": "오래된 번역기",
|
||||
"翻译器加载失败": "번역기 로드 실패"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Geen beschikbare talen",
|
||||
"过时的词典": "Verouderd woordenboek",
|
||||
"其他工具": "Andere hulpmiddelen",
|
||||
"过时的翻译器": "Verouderde vertaler"
|
||||
"过时的翻译器": "Verouderde vertaler",
|
||||
"翻译器加载失败": "Laden van vertaler mislukt"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Brak dostępnych języków",
|
||||
"过时的词典": "Przestarzały słownik",
|
||||
"其他工具": "Inne narzędzia",
|
||||
"过时的翻译器": "Przestarzały tłumacz"
|
||||
"过时的翻译器": "Przestarzały tłumacz",
|
||||
"翻译器加载失败": "Wczytanie tłumacza nie powiodło się"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Sem línguas disponíveis",
|
||||
"过时的词典": "Dicionário desatualizado",
|
||||
"其他工具": "Outras ferramentas",
|
||||
"过时的翻译器": "Tradutor desatualizado"
|
||||
"过时的翻译器": "Tradutor desatualizado",
|
||||
"翻译器加载失败": "O carregamento do tradutor falhou"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Нет доступных языков",
|
||||
"过时的词典": "Устаревший словарь",
|
||||
"其他工具": "Другие инструменты",
|
||||
"过时的翻译器": "Устаревший переводчик"
|
||||
"过时的翻译器": "Устаревший переводчик",
|
||||
"翻译器加载失败": "Ошибка загрузки переводчика"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Inga tillgängliga språk",
|
||||
"过时的词典": "Föråldrad ordlista",
|
||||
"其他工具": "Andra verktyg",
|
||||
"过时的翻译器": "Föråldrad översättare"
|
||||
"过时的翻译器": "Föråldrad översättare",
|
||||
"翻译器加载失败": "Laddning av översättare misslyckades"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "ไม่มีภาษา",
|
||||
"过时的词典": "พจนานุกรมที่ล้าสมัย",
|
||||
"其他工具": "เครื่องมืออื่นๆ",
|
||||
"过时的翻译器": "นักแปลล้าสมัย"
|
||||
"过时的翻译器": "นักแปลล้าสมัย",
|
||||
"翻译器加载失败": "โหลดนักแปลล้มเหลว"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Mevcut diller yok",
|
||||
"过时的词典": "Eski sözlük",
|
||||
"其他工具": "Diğer araçlar",
|
||||
"过时的翻译器": "Eski çeviriciler"
|
||||
"过时的翻译器": "Eski çeviriciler",
|
||||
"翻译器加载失败": "Çevirme yüklemesi başarısız oldu"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Немає доступних мов",
|
||||
"过时的词典": "Outdated dictionary",
|
||||
"其他工具": "Інші інструменти",
|
||||
"过时的翻译器": "Старений перекладач"
|
||||
"过时的翻译器": "Старений перекладач",
|
||||
"翻译器加载失败": "Спроба завантаження перекладача зазнала невдачі"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "Không có ngôn ngữ",
|
||||
"过时的词典": "Từ điển lỗi thời",
|
||||
"其他工具": "Công cụ khác",
|
||||
"过时的翻译器": "Trình dịch lỗi thời"
|
||||
"过时的翻译器": "Trình dịch lỗi thời",
|
||||
"翻译器加载失败": "Trình dịch không tải được"
|
||||
}
|
@ -810,5 +810,6 @@
|
||||
"无可用语言": "",
|
||||
"过时的词典": "",
|
||||
"过时的翻译器": "",
|
||||
"其他工具": ""
|
||||
"其他工具": "",
|
||||
"翻译器加载失败": ""
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user