diff --git a/tools/scripts/createTranslationChangelog.ts b/tools/scripts/createTranslationChangelog.ts index 89ab328b..728cb706 100644 --- a/tools/scripts/createTranslationChangelog.ts +++ b/tools/scripts/createTranslationChangelog.ts @@ -178,7 +178,7 @@ const getUsername = async (url: string, authToken: string): Promise => { const getLanguageName = async (url: string, authToken: string): Promise => { const languagePayload = await fetchData(url, authToken); - return languagePayload.language.name; + return languagePayload.language.name.replace(/\(([a-zA-Z]+) Han script\)/g, '($1)'); }; const extractContributionInfoFromChanges = ( @@ -381,15 +381,20 @@ const createTranslationChangelog = async (): Promise => { 'Thank you for your contribution to the translation of the project.\n', ); - console.log('### Added'); - newLanguages.forEach(({ language, contributors }) => { - console.log(`- ${language} (by ${contributors.join(', ')})`); - }); - console.log(''); - console.log('### Updated'); - updatedLanguages.forEach(({ language, contributors }) => { - console.log(`- ${language} (by ${contributors.join(', ')})`); - }); + if (newLanguages.length) { + console.log('### Added'); + newLanguages.forEach(({ language, contributors }) => { + console.log(`- ${language} (by ${contributors.join(', ')})`); + }); + console.log(''); + } + + if (updatedLanguages.length) { + console.log('### Updated'); + updatedLanguages.forEach(({ language, contributors }) => { + console.log(`- ${language} (by ${contributors.join(', ')})`); + }); + } }; createTranslationChangelog();