diff --git a/tools/scripts/createTranslationChangelog.ts b/tools/scripts/createTranslationChangelog.ts index d217f9b8..b3937d6c 100644 --- a/tools/scripts/createTranslationChangelog.ts +++ b/tools/scripts/createTranslationChangelog.ts @@ -88,18 +88,32 @@ const creditRelevantActions = [ WeblateChangeActions.MARKED_FOR_EDIT, ]; -const { afterDate, beforeDate } = yargs +const { afterDate, beforeDate, requiredContributionCount, keepKnownContributors } = yargs .options({ afterDate: { + alias: 'ad', description: 'IS0-8601 formatted date (included) (e.g. 2024-05-01)', type: 'string', demandOption: true, }, beforeDate: { + alias: 'bd', description: 'IS0-8601 formatted date (excluded) (e.g. 2024-05-11)', type: 'string', demandOption: true, }, + requiredContributionCount: { + alias: 'rcc', + description: 'The minimum number of contributions for a language to be considered a contributor', + type: 'number', + default: 10, + }, + keepKnownContributors: { + alias: 'kc', + description: 'Ignore "requiredContributionCount" for known contributors of a language', + type: 'boolean', + default: true, + }, }) .parseSync(); @@ -334,7 +348,8 @@ const createTranslationChangelog = async (): Promise => { ([language, languageContributors]) => { const validContributors = languageContributors.filter( ({ username, contributionCount }) => - knownContributorsByLanguage[language]?.includes(username) || contributionCount >= 10, + (keepKnownContributors && knownContributorsByLanguage[language]?.includes(username)) || + contributionCount >= requiredContributionCount, ); const contributors = validContributors.length ? validContributors : [languageContributors[0]];