mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 13:20:30 +08:00
ci: replacing 100% and 100.00% with √ for translation progress in README.md
This commit is contained in:
@@ -25,7 +25,7 @@ async function calculateTranslationRate() {
|
||||
const files = (await fs.readdir(localesDir)).filter(file => file !== 'en_US.axaml' && file.endsWith('.axaml'));
|
||||
|
||||
// Add en_US badge first
|
||||
badges.push(`[](TRANSLATION.md)`);
|
||||
badges.push(`[](TRANSLATION.md)`);
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(localesDir, file);
|
||||
@@ -40,8 +40,12 @@ async function calculateTranslationRate() {
|
||||
|
||||
// Add badges
|
||||
const locale = file.replace('.axaml', '').replace('_', '__');
|
||||
const badgeColor = translationRate === 100 ? 'brightgreen' : translationRate >= 75 ? 'yellow' : 'red';
|
||||
badges.push(`[}%25-${badgeColor})](TRANSLATION.md)`);
|
||||
if (translationRate === 100) {
|
||||
badges.push(`[](TRANSLATION.md)`);
|
||||
} else {
|
||||
const badgeColor = translationRate >= 75 ? 'yellow' : 'red';
|
||||
badges.push(`[}%25-${badgeColor})](TRANSLATION.md)`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(translationRates.join('\n\n'));
|
||||
|
||||
Reference in New Issue
Block a user