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.
This commit is contained in:
Jonas Jenwald 2019-10-06 17:55:48 +02:00
parent 8d74a9ae7f
commit dee3da69d4

View File

@ -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();
}