mirror of
https://mirror.ghproxy.com/https://github.com/StarCitizenToolBox/StarCitizenBoxBrowserEx.git
synced 2024-12-22 19:33:43 +08:00
适配机库升级包
This commit is contained in:
parent
974f196869
commit
d5d02d933a
@ -144,7 +144,21 @@ function GetSCLocalizationTranslateString(txtSrc) {
|
|||||||
} else if (SCLocalizationEnableSplitMode) {
|
} else if (SCLocalizationEnableSplitMode) {
|
||||||
if (sourceKey.includes(" - ")) {
|
if (sourceKey.includes(" - ")) {
|
||||||
let nodeValue = txtSrc
|
let nodeValue = txtSrc
|
||||||
sourceKey.split(" - ").forEach(function (splitKey) {
|
let splitKey = sourceKey.split(" - ");
|
||||||
|
if (splitKey[0].toLowerCase() === "upgrade" && key.includes("to") && key.endsWith("edition")) {
|
||||||
|
// 升级包规则
|
||||||
|
let noVersionStr = key.replace("STANDARD EDITION".toLowerCase(), "").replace("upgrade", "").replace("WARBOND EDITION".toLowerCase(), "")
|
||||||
|
let shipNames = noVersionStr.split(" to ")
|
||||||
|
let finalString = "升级包 " + GetSCLocalizationTranslateString(shipNames[0]) + " 到 " + GetSCLocalizationTranslateString(shipNames[1]);
|
||||||
|
if (key.endsWith("WARBOND EDITION".toLowerCase())) {
|
||||||
|
finalString = finalString + " 战争债券版"
|
||||||
|
} else {
|
||||||
|
finalString = finalString + " 标准版"
|
||||||
|
}
|
||||||
|
txtSrc = finalString
|
||||||
|
} else {
|
||||||
|
// 机库通用规则
|
||||||
|
splitKey.forEach(function (splitKey) {
|
||||||
if (SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()]) {
|
if (SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()]) {
|
||||||
nodeValue = nodeValue.replace(splitKey, SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()])
|
nodeValue = nodeValue.replace(splitKey, SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()])
|
||||||
} else {
|
} else {
|
||||||
@ -152,6 +166,7 @@ function GetSCLocalizationTranslateString(txtSrc) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
txtSrc = nodeValue
|
txtSrc = nodeValue
|
||||||
|
}
|
||||||
} else if (key.endsWith("starter pack") || key.endsWith("starter package")) {
|
} else if (key.endsWith("starter pack") || key.endsWith("starter package")) {
|
||||||
let shipName = key.replace("starter package", "").replace("starter pack", "").trim()
|
let shipName = key.replace("starter package", "").replace("starter pack", "").trim()
|
||||||
if (SCLocalizationReplaceLocalesMap[shipName.toLowerCase()]) {
|
if (SCLocalizationReplaceLocalesMap[shipName.toLowerCase()]) {
|
||||||
@ -161,7 +176,7 @@ function GetSCLocalizationTranslateString(txtSrc) {
|
|||||||
} else if (key.startsWith("the ") && SCLocalizationReplaceLocalesMap[noTheKey]) {
|
} else if (key.startsWith("the ") && SCLocalizationReplaceLocalesMap[noTheKey]) {
|
||||||
txtSrc = SCLocalizationReplaceLocalesMap[noTheKey];
|
txtSrc = SCLocalizationReplaceLocalesMap[noTheKey];
|
||||||
} else if (key.startsWith("- ") && SCLocalizationReplaceLocalesMap[noHorizontalKey]) {
|
} else if (key.startsWith("- ") && SCLocalizationReplaceLocalesMap[noHorizontalKey]) {
|
||||||
txtSrc = "- "+SCLocalizationReplaceLocalesMap[noHorizontalKey];
|
txtSrc = "- " + SCLocalizationReplaceLocalesMap[noHorizontalKey];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return txtSrc
|
return txtSrc
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 3,
|
"manifest_version": 3,
|
||||||
"name": "星际公民盒子浏览器拓展",
|
"name": "星际公民盒子浏览器拓展",
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"description": "为星际公民网站及工具站提供汉化",
|
"description": "为星际公民网站及工具站提供汉化",
|
||||||
"author": "xkeyC",
|
"author": "xkeyC",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
@ -144,7 +144,21 @@ function GetSCLocalizationTranslateString(txtSrc) {
|
|||||||
} else if (SCLocalizationEnableSplitMode) {
|
} else if (SCLocalizationEnableSplitMode) {
|
||||||
if (sourceKey.includes(" - ")) {
|
if (sourceKey.includes(" - ")) {
|
||||||
let nodeValue = txtSrc
|
let nodeValue = txtSrc
|
||||||
sourceKey.split(" - ").forEach(function (splitKey) {
|
let splitKey = sourceKey.split(" - ");
|
||||||
|
if (splitKey[0].toLowerCase() === "upgrade" && key.includes("to") && key.endsWith("edition")) {
|
||||||
|
// 升级包规则
|
||||||
|
let noVersionStr = key.replace("STANDARD EDITION".toLowerCase(), "").replace("upgrade", "").replace("WARBOND EDITION".toLowerCase(), "")
|
||||||
|
let shipNames = noVersionStr.split(" to ")
|
||||||
|
let finalString = "升级包 " + GetSCLocalizationTranslateString(shipNames[0]) + " 到 " + GetSCLocalizationTranslateString(shipNames[1]);
|
||||||
|
if (key.endsWith("WARBOND EDITION".toLowerCase())) {
|
||||||
|
finalString = finalString + " 战争债券版"
|
||||||
|
} else {
|
||||||
|
finalString = finalString + " 标准版"
|
||||||
|
}
|
||||||
|
txtSrc = finalString
|
||||||
|
} else {
|
||||||
|
// 机库通用规则
|
||||||
|
splitKey.forEach(function (splitKey) {
|
||||||
if (SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()]) {
|
if (SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()]) {
|
||||||
nodeValue = nodeValue.replace(splitKey, SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()])
|
nodeValue = nodeValue.replace(splitKey, SCLocalizationReplaceLocalesMap[splitKey.toLowerCase()])
|
||||||
} else {
|
} else {
|
||||||
@ -152,6 +166,7 @@ function GetSCLocalizationTranslateString(txtSrc) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
txtSrc = nodeValue
|
txtSrc = nodeValue
|
||||||
|
}
|
||||||
} else if (key.endsWith("starter pack") || key.endsWith("starter package")) {
|
} else if (key.endsWith("starter pack") || key.endsWith("starter package")) {
|
||||||
let shipName = key.replace("starter package", "").replace("starter pack", "").trim()
|
let shipName = key.replace("starter package", "").replace("starter pack", "").trim()
|
||||||
if (SCLocalizationReplaceLocalesMap[shipName.toLowerCase()]) {
|
if (SCLocalizationReplaceLocalesMap[shipName.toLowerCase()]) {
|
||||||
@ -161,7 +176,7 @@ function GetSCLocalizationTranslateString(txtSrc) {
|
|||||||
} else if (key.startsWith("the ") && SCLocalizationReplaceLocalesMap[noTheKey]) {
|
} else if (key.startsWith("the ") && SCLocalizationReplaceLocalesMap[noTheKey]) {
|
||||||
txtSrc = SCLocalizationReplaceLocalesMap[noTheKey];
|
txtSrc = SCLocalizationReplaceLocalesMap[noTheKey];
|
||||||
} else if (key.startsWith("- ") && SCLocalizationReplaceLocalesMap[noHorizontalKey]) {
|
} else if (key.startsWith("- ") && SCLocalizationReplaceLocalesMap[noHorizontalKey]) {
|
||||||
txtSrc = "- "+SCLocalizationReplaceLocalesMap[noHorizontalKey];
|
txtSrc = "- " + SCLocalizationReplaceLocalesMap[noHorizontalKey];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return txtSrc
|
return txtSrc
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"manifest_version": 2,
|
"manifest_version": 2,
|
||||||
"name": "星际公民盒子浏览器拓展",
|
"name": "星际公民盒子浏览器拓展",
|
||||||
"version": "0.0.3",
|
"version": "0.0.4",
|
||||||
"description": "为星际公民网站及工具站提供汉化",
|
"description": "为星际公民网站及工具站提供汉化",
|
||||||
"author": "xkeyC",
|
"author": "xkeyC",
|
||||||
"icons": {
|
"icons": {
|
||||||
|
Loading…
Reference in New Issue
Block a user