Skip to content

Commit

Permalink
updated the workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
gokadzev committed Aug 11, 2023
1 parent 04d08bd commit d2cf231
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@
<!-- START_TRANSLATION_STATS -->
| Language | Language Code | Translated Texts | Total Texts | Translation Percentage |
|----------------|---------------|------------------|-------------|------------------------|
| Chinese | zh | 31 | 71 | 43.66% |
| Georgian | ka | 71 | 71 | 100.00% |
| Portuguese | pt | 71 | 71 | 100.00% |
| French | fr | 66 | 71 | 92.96% |
| Greek | el | 65 | 71 | 91.55% |
| Italian | it | 30 | 71 | 42.25% |
| Russian | ru | 62 | 71 | 87.32% |
| Spanish | es | 60 | 71 | 84.51% |
| German | de | 55 | 71 | 77.46% |
| Arabic | ar | 55 | 71 | 77.46% |
| Vietnamese | vi | 53 | 71 | 74.65% |
| Russian | ru | 62 | 71 | 87.32% |
| Portuguese | pt | 71 | 71 | 100.00% |
| Ukrainian | uk | 48 | 71 | 67.61% |
| Turkish | tr | 44 | 71 | 61.97% |
| Traditional Chinese Taiwan | zh_TW | 43 | 71 | 60.56% |
| French | fr | 66 | 71 | 92.96% |
| Indonesian | id | 31 | 71 | 43.66% |
| Georgian | ka | 71 | 71 | 100.00% |
| Dutch | nl | 31 | 71 | 43.66% |
| Ukrainian | uk | 48 | 71 | 67.61% |
| Chinese | zh | 31 | 71 | 43.66% |
| Polish | pl | 31 | 71 | 43.66% |
| Spanish | es | 60 | 71 | 84.51% |
| German | de | 55 | 71 | 77.46% |
| Indonesian | id | 31 | 71 | 43.66% |
| Italian | it | 30 | 71 | 42.25% |
| Overall | - | 847 | 1207 | 70.17% |
<!-- END_TRANSLATION_STATS -->

Expand Down
4 changes: 3 additions & 1 deletion translated.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def count_translated_texts(english_data, translation_data):
translated_texts = sum(1 for key, value in translation_data.items() if value and not are_translations_equal(value, english_data.get(key, '')))

return translated_texts, total_texts

def calculate_percentage(translated_count, total_count):
if total_count == 0:
return 0.0
Expand Down Expand Up @@ -74,6 +75,7 @@ def main():
translated_percentage = calculate_percentage(translated_texts, total)
statistics_rows.append((language_name, language_code, translated_texts, total, translated_percentage))

statistics_rows.sort(key=lambda x: x[4], reverse=True)

overall_translated_texts = sum(row[2] for row in statistics_rows)
overall_total_texts = sum(row[3] for row in statistics_rows)
Expand All @@ -91,4 +93,4 @@ def main():
update_readme_statistics(readme_path, statistics_content)

if __name__ == "__main__":
main()
main()

0 comments on commit d2cf231

Please sign in to comment.