1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-01-26 18:58:21 +02:00

Tools: Better handling of translation messages in changelog

This commit is contained in:
Laurent Cozic 2020-04-20 18:10:27 +00:00
parent e7169cc70d
commit dd5ed48c7e

View File

@ -47,6 +47,8 @@ function filterLogs(logs, platform) {
const output = []; const output = [];
const revertedLogs = []; const revertedLogs = [];
let updatedTranslations = false;
for (const log of logs) { for (const log of logs) {
// Save to an array any commit that has been reverted, and exclude // Save to an array any commit that has been reverted, and exclude
@ -74,9 +76,20 @@ function filterLogs(logs, platform) {
if (platform === 'cli' && prefix.indexOf('cli') >= 0) addIt = true; if (platform === 'cli' && prefix.indexOf('cli') >= 0) addIt = true;
if (platform === 'clipper' && prefix.indexOf('clipper') >= 0) addIt = true; if (platform === 'clipper' && prefix.indexOf('clipper') >= 0) addIt = true;
// Translation updates often comes in format "Translation: Update pt_PT.po"
// but that's not useful in a changelog especially since most people
// don't know country and language codes. So we catch all these and
// bundle them all up in a single "Updated translations" at the end.
if (log.message.match(/Translation: Update .*?\.po/)) {
updatedTranslations = true;
addIt = false;
}
if (addIt) output.push(log); if (addIt) output.push(log);
} }
if (updatedTranslations) output.push({ message: 'Updated translations' });
return output; return output;
} }