Update 0BDFDB.plugin.js

This commit is contained in:
Mirco Wittrien 2024-05-11 17:57:25 +02:00
parent bb0db8a635
commit 087010763f
1 changed files with 1 additions and 1 deletions

View File

@ -8546,7 +8546,7 @@ module.exports = (_ => {
let format = config.asObject ? ((l, isNotFirst) => {
return `${isNotFirst ? "," : ""}\n\t\t"${l == "en" ? "default" : l}": {${translations[l].map((s, i) => `\n\t\t\t"${stringKeys[i]}": "${formatTranslation(l, s, i)}"`).join(",")}\n\t\t}`;
}) : ((l, isNotFirst) => {
return `\n\t\t\t\t\t${l == "en" ? "default" : `case "${l}"`}:${l.length > 2 ? "\t" : "\t\t"}// ${BDFDB.LanguageUtils.languages[l].name}\n\t\t\t\t\t\treturn {${translations[l].map((s, i) => `\n\t\t\t\t\t\t\t${stringKeys[i]}:${"\t".repeat(10 - ((stringKeys[i].length + 2) / 4))}"${formatTranslation(l, s, i)}"`).join(",")}\n\t\t\t\t\t\t};`;
return `\n\t\t\t\t\t${l == "en" ? "default" : `case "${l}"`}:"\t\t"// ${BDFDB.LanguageUtils.languages[l].name}\n\t\t\t\t\t\treturn {${translations[l].map((s, i) => `\n\t\t\t\t\t\t\t${stringKeys[i]}:${"\t".repeat(10 - ((stringKeys[i].length + 2) / 4))}"${formatTranslation(l, s, i)}"`).join(",")}\n\t\t\t\t\t\t};`;
});
let result = Object.keys(translations).filter(n => n != "en").sort().map((l, i) => format(l, i)).join("");
if (translations.en) result += format("en", result ? 1 : 0);