Skip to content

Commit 1e5ec7a

Browse files
committed
ci: replacing 100% and 100.00% with for translation progress in README.md
1 parent 6ae6609 commit 1e5ec7a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

build/scripts/localization-check.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function calculateTranslationRate() {
2525
const files = (await fs.readdir(localesDir)).filter(file => file !== 'en_US.axaml' && file.endsWith('.axaml'));
2626

2727
// Add en_US badge first
28-
badges.push(`[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md)`);
28+
badges.push(`[![en_US](https://img.shields.io/badge/en_US-%E2%88%9A-brightgreen)](TRANSLATION.md)`);
2929

3030
for (const file of files) {
3131
const filePath = path.join(localesDir, file);
@@ -41,7 +41,11 @@ async function calculateTranslationRate() {
4141
// Add badges
4242
const locale = file.replace('.axaml', '').replace('_', '__');
4343
const badgeColor = translationRate === 100 ? 'brightgreen' : translationRate >= 75 ? 'yellow' : 'red';
44-
badges.push(`[![${locale}](https://img.shields.io/badge/${locale}-${translationRate.toFixed(2)}%25-${badgeColor})](TRANSLATION.md)`);
44+
if (translationRate === 100) {
45+
badges.push(`[![${locale}](https://img.shields.io/badge/${locale}-%E2%88%9A-brightgreen)](TRANSLATION.md)`);
46+
} else {
47+
badges.push(`[![${locale}](https://img.shields.io/badge/${locale}-${translationRate.toFixed(2)}%25-${badgeColor})](TRANSLATION.md)`);
48+
}
4549
}
4650

4751
console.log(translationRates.join('\n\n'));

0 commit comments

Comments
 (0)