mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
doc: Make the badges clickable and redirect to the TRANSLATION.md (#601)
* Make the badges clickable and redirect to the TRANSLATION.md * Move localization check script file position --------- Signed-off-by: Gadfly <gadfly@gadfly.vip>
This commit is contained in:
parent
7e1624c2d6
commit
28773f0e2d
4 changed files with 6 additions and 6 deletions
2
.github/workflows/localization-check.yml
vendored
2
.github/workflows/localization-check.yml
vendored
|
@ -25,7 +25,7 @@ jobs:
|
|||
run: npm install fs-extra@11.2.0 path@0.12.7 xml2js@0.6.2
|
||||
|
||||
- name: Run localization check
|
||||
run: node .github/scripts/localization-check.js
|
||||
run: node build/scripts/localization-check.js
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
## Translation Status
|
||||
|
||||
      
|
||||
[](TRANSLATION.md) [](TRANSLATION.md) [](TRANSLATION.md) [](TRANSLATION.md) [](TRANSLATION.md) [](TRANSLATION.md) [](TRANSLATION.md)
|
||||
|
||||
## How to Use
|
||||
|
||||
|
|
|
@ -180,4 +180,4 @@
|
|||
- Text.Preference.AI.AnalyzeDiffPrompt
|
||||
- Text.Preference.AI.GenerateSubjectPrompt
|
||||
|
||||
</details>
|
||||
</details>
|
||||
|
|
|
@ -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(``);
|
||||
badges.push(`[](TRANSLATION.md)`);
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(localesDir, file);
|
||||
|
@ -41,12 +41,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})`);
|
||||
badges.push(`[}%25-${badgeColor})](TRANSLATION.md)`);
|
||||
}
|
||||
|
||||
console.log(translationRates.join('\n\n'));
|
||||
|
||||
await fs.writeFile(outputFile, translationRates.join('\n\n'), 'utf8');
|
||||
await fs.writeFile(outputFile, translationRates.join('\n\n') + '\n', 'utf8');
|
||||
|
||||
// Update README.md
|
||||
let readmeContent = await fs.readFile(readmeFile, 'utf8');
|
Loading…
Add table
Add a link
Reference in a new issue