keep the old match function avaliable

This commit is contained in:
sgmklp
2022-10-17 02:03:45 +08:00
parent b0bc2d9b0b
commit d8ec8793fa
2 changed files with 16 additions and 7 deletions

View File

@@ -523,15 +523,23 @@ onUiUpdate(function () {
if (acConfig.translation.extraTranslationFile) {
try {
allTranslations = loadCSV(`file/tags/${acConfig.translation.extraTranslationFile}`);
allTranslations.map(x => {
if (x[2]) {
for (let i = 0; i < allTags.length; i++) {
if (x[0] === allTags[i][0] && x[1] === allTags[i][1]) {
allTags[i][2] = x[2];
}
if (acConfig.simpleExtraTranslationFile) {
for (let i = 0; i < allTranslations.length; i++) {
if (allTranslations[i][0]) {
allTags[i][2] = allTranslations[i][0];
}
}
});
} else {
allTranslations.map(x => {
if (x[2]) {
for (let i = 0; i < allTags.length; i++) {
if (x[0] === allTags[i][0] && x[1] === allTags[i][1]) {
allTags[i][2] = x[2];
}
}
}
});
}
} catch (e) {
console.error("Error loading extra translation file: " + e);
return;