From bb6cc49c1691c2df59564cd07c138b9e754b0f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Sun, 6 Dec 2020 19:10:56 -0500 Subject: [PATCH] perf: dont build identical langs --- src/meta/languages.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/meta/languages.js b/src/meta/languages.js index 5f27486fd3..7487c2b8d7 100644 --- a/src/meta/languages.js +++ b/src/meta/languages.js @@ -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 */