perf: dont build identical langs

v1.18.x
Barış Soner Uşaklı 4 years ago
parent 86f0f82be7
commit bb6cc49c16

@ -107,12 +107,12 @@ async function addPlugin(translations, pluginData, lang, namespace) {
// 2. old language string (en_GB)
// 3. corrected plugin defaultLang (en-US)
// 4. old plugin defaultLang (en_US)
const langs = [
const langs = _.uniq([
defaultLang.replace('-', '_').replace('-x-', '@'),
defaultLang.replace('_', '-').replace('@', '-x-'),
lang.replace('-', '_').replace('-x-', '@'),
lang,
];
]);
for (const language of langs) {
/* eslint-disable no-await-in-loop */

Loading…
Cancel
Save