From dee3da69d48c17a1eb7ea457fa6104f46c7aa85c Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 6 Oct 2019 17:55:48 +0200 Subject: [PATCH] Have `gulp importl10n` list locales which may be candidates for removal Rather than having the script remove locales automatically, which seems like a heavy-handed approach at least initially, listing these for manual checking seems nice though. --- external/importL10n/locales.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/external/importL10n/locales.js b/external/importL10n/locales.js index f8c43cfc9..3ea65e627 100644 --- a/external/importL10n/locales.js +++ b/external/importL10n/locales.js @@ -110,6 +110,21 @@ async function downloadL10n(root, callback) { } await downloadLanguageFiles(root, langCode); } + + var removeCodes = []; + for (var entry of fs.readdirSync(root)) { + var dirPath = path.join(root, entry), stat = fs.lstatSync(dirPath); + + if (stat.isDirectory() && entry !== 'en-US' && + (!langCodes.includes(entry) || EXCLUDE_LANG_CODES.includes(entry))) { + removeCodes.push(entry); + } + } + if (removeCodes.length) { + console.log('\nConsider removing the following unmaintained locales:\n' + + removeCodes.join(', ') + '\n'); + } + if (callback) { callback(); }