[SKIP CI][Tooling] Update translation changelog script
Weblate changed the language names of chinese simplified and traditional to include "Han script". This messed up the updated language detection
This commit is contained in:
@@ -178,7 +178,7 @@ const getUsername = async (url: string, authToken: string): Promise<string> => {
|
|||||||
|
|
||||||
const getLanguageName = async (url: string, authToken: string): Promise<string> => {
|
const getLanguageName = async (url: string, authToken: string): Promise<string> => {
|
||||||
const languagePayload = await fetchData<WeblateLanguagePayload>(url, authToken);
|
const languagePayload = await fetchData<WeblateLanguagePayload>(url, authToken);
|
||||||
return languagePayload.language.name;
|
return languagePayload.language.name.replace(/\(([a-zA-Z]+) Han script\)/g, '($1)');
|
||||||
};
|
};
|
||||||
|
|
||||||
const extractContributionInfoFromChanges = (
|
const extractContributionInfoFromChanges = (
|
||||||
@@ -381,15 +381,20 @@ const createTranslationChangelog = async (): Promise<void> => {
|
|||||||
'Thank you for your contribution to the translation of the project.\n',
|
'Thank you for your contribution to the translation of the project.\n',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (newLanguages.length) {
|
||||||
console.log('### Added');
|
console.log('### Added');
|
||||||
newLanguages.forEach(({ language, contributors }) => {
|
newLanguages.forEach(({ language, contributors }) => {
|
||||||
console.log(`- ${language} (by ${contributors.join(', ')})`);
|
console.log(`- ${language} (by ${contributors.join(', ')})`);
|
||||||
});
|
});
|
||||||
console.log('');
|
console.log('');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (updatedLanguages.length) {
|
||||||
console.log('### Updated');
|
console.log('### Updated');
|
||||||
updatedLanguages.forEach(({ language, contributors }) => {
|
updatedLanguages.forEach(({ language, contributors }) => {
|
||||||
console.log(`- ${language} (by ${contributors.join(', ')})`);
|
console.log(`- ${language} (by ${contributors.join(', ')})`);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
createTranslationChangelog();
|
createTranslationChangelog();
|
||||||
|
|||||||
Reference in New Issue
Block a user