also add Tags in extra file without translation

This commit is contained in:
sgmklp
2022-10-17 03:47:26 +08:00
parent 59ccb7ac19
commit d5636f9026
2 changed files with 15 additions and 15 deletions

View File

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