mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-23 01:36:57 -08:00
ci: replacing 100%
and 100.00%
with √
for translation progress in README.md
This commit is contained in:
parent
6ae66095c2
commit
75288e7a31
1 changed files with 7 additions and 3 deletions
|
@ -25,7 +25,7 @@ async function calculateTranslationRate() {
|
||||||
const files = (await fs.readdir(localesDir)).filter(file => file !== 'en_US.axaml' && file.endsWith('.axaml'));
|
const files = (await fs.readdir(localesDir)).filter(file => file !== 'en_US.axaml' && file.endsWith('.axaml'));
|
||||||
|
|
||||||
// Add en_US badge first
|
// Add en_US badge first
|
||||||
badges.push(`[![en_US](https://img.shields.io/badge/en__US-100%25-brightgreen)](TRANSLATION.md)`);
|
badges.push(`[![en_US](https://img.shields.io/badge/en_US-%E2%88%9A-brightgreen)](TRANSLATION.md)`);
|
||||||
|
|
||||||
for (const file of files) {
|
for (const file of files) {
|
||||||
const filePath = path.join(localesDir, file);
|
const filePath = path.join(localesDir, file);
|
||||||
|
@ -40,8 +40,12 @@ async function calculateTranslationRate() {
|
||||||
|
|
||||||
// Add badges
|
// Add badges
|
||||||
const locale = file.replace('.axaml', '').replace('_', '__');
|
const locale = file.replace('.axaml', '').replace('_', '__');
|
||||||
const badgeColor = translationRate === 100 ? 'brightgreen' : translationRate >= 75 ? 'yellow' : 'red';
|
if (translationRate === 100) {
|
||||||
badges.push(`[![${locale}](https://img.shields.io/badge/${locale}-${translationRate.toFixed(2)}%25-${badgeColor})](TRANSLATION.md)`);
|
badges.push(`[![${locale}](https://img.shields.io/badge/${locale}-%E2%88%9A-brightgreen)](TRANSLATION.md)`);
|
||||||
|
} else {
|
||||||
|
const badgeColor = translationRate >= 75 ? 'yellow' : 'red';
|
||||||
|
badges.push(`[![${locale}](https://img.shields.io/badge/${locale}-${translationRate.toFixed(2)}%25-${badgeColor})](TRANSLATION.md)`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(translationRates.join('\n\n'));
|
console.log(translationRates.join('\n\n'));
|
||||||
|
|
Loading…
Reference in a new issue