mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/app.git
synced 2024-12-22 22:13:46 +08:00
This commit is contained in:
parent
2a940b9312
commit
495dfd2c94
@ -197,8 +197,6 @@ function GetSCLocalizationTranslateString(txtSrc) {
|
|||||||
return txtSrc
|
return txtSrc
|
||||||
}
|
}
|
||||||
|
|
||||||
InitWebLocalization();
|
|
||||||
|
|
||||||
function ReportUnTranslate(k, v) {
|
function ReportUnTranslate(k, v) {
|
||||||
|
|
||||||
if (enable_webview_localization_capture) {
|
if (enable_webview_localization_capture) {
|
||||||
|
@ -71,12 +71,7 @@ class WebViewModel {
|
|||||||
dPrint("webview Navigating url === $url");
|
dPrint("webview Navigating url === $url");
|
||||||
if (url.contains("robertsspaceindustries.com")) {
|
if (url.contains("robertsspaceindustries.com")) {
|
||||||
// SC 官网
|
// SC 官网
|
||||||
dPrint("load script");
|
|
||||||
await Future.delayed(const Duration(milliseconds: 100));
|
|
||||||
await webview.evaluateJavaScript(localizationScript);
|
|
||||||
dPrint("update replaceWords");
|
|
||||||
final replaceWords = _getLocalizationResource("zh-CN");
|
final replaceWords = _getLocalizationResource("zh-CN");
|
||||||
|
|
||||||
const org = "https://robertsspaceindustries.com/orgs";
|
const org = "https://robertsspaceindustries.com/orgs";
|
||||||
const citizens = "https://robertsspaceindustries.com/citizens";
|
const citizens = "https://robertsspaceindustries.com/citizens";
|
||||||
const organization =
|
const organization =
|
||||||
@ -90,13 +85,16 @@ class WebViewModel {
|
|||||||
|
|
||||||
const hangar = "https://robertsspaceindustries.com/account/pledges";
|
const hangar = "https://robertsspaceindustries.com/account/pledges";
|
||||||
|
|
||||||
const spectrum =
|
const spectrum = "https://robertsspaceindustries.com/spectrum";
|
||||||
"https://robertsspaceindustries.com/spectrum/community/";
|
|
||||||
// 跳过光谱论坛 https://github.com/StarCitizenToolBox/StarCitizenBoxBrowserEx/issues/1
|
// 跳过光谱论坛 https://github.com/StarCitizenToolBox/StarCitizenBoxBrowserEx/issues/1
|
||||||
if (url.startsWith(spectrum)) {
|
if (url.startsWith(spectrum)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dPrint("load script");
|
||||||
|
await Future.delayed(const Duration(milliseconds: 100));
|
||||||
|
await webview.evaluateJavaScript(localizationScript);
|
||||||
|
|
||||||
if (url.startsWith(org) ||
|
if (url.startsWith(org) ||
|
||||||
url.startsWith(citizens) ||
|
url.startsWith(citizens) ||
|
||||||
url.startsWith(organization)) {
|
url.startsWith(organization)) {
|
||||||
@ -144,7 +142,9 @@ class WebViewModel {
|
|||||||
_curReplaceWords?[element["word"] ?? ""] =
|
_curReplaceWords?[element["word"] ?? ""] =
|
||||||
element["replacement"] ?? "";
|
element["replacement"] ?? "";
|
||||||
}
|
}
|
||||||
|
await webview.evaluateJavaScript("InitWebLocalization()");
|
||||||
await Future.delayed(const Duration(milliseconds: 100));
|
await Future.delayed(const Duration(milliseconds: 100));
|
||||||
|
dPrint("update replaceWords");
|
||||||
await webview.evaluateJavaScript(
|
await webview.evaluateJavaScript(
|
||||||
"WebLocalizationUpdateReplaceWords(${json.encode(replaceWords)},$enableCapture)");
|
"WebLocalizationUpdateReplaceWords(${json.encode(replaceWords)},$enableCapture)");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user