Skip to content

Commit e1e63f8

Browse files
committed
Add alt text to contributions plot
1 parent 3faf7b2 commit e1e63f8

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ python3 scripts/translation_status.py --only-incomplete
6161

6262
<!-- STATS_START -->
6363
### مشارکت‌های کاربران
64-
![مشارکت‌های کاربران](reports/contributor_stats_latest.png)
64+
![نمودار مشارکت‌های کاربران؛ Revisto 3984، sepehr-rs 1571، danialbehzadi 677، invincible627 317، khosro_o 63، ParhamF 41، Ariyan_Bolandi 37، nikovinix7878 13، thaghgoo 12، Ramiz_222 10](reports/contributor_stats_latest.png)
6565
(به‌روزرسانی: 2026-08-14)
6666
<!-- STATS_END -->

scripts/contributor_chart.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,21 @@ def draw_chart(data: list[tuple[str, int]], top_n: int) -> None:
9797
plt.tight_layout()
9898

9999

100-
def refresh_readme(chart_file: Path, dry_run: bool) -> bool:
100+
def refresh_readme(
101+
chart_file: Path,
102+
dry_run: bool,
103+
top_contribs: list[tuple[str, int]],
104+
) -> bool:
101105
text = README_PATH.read_text(encoding="utf-8")
102106
date_iso = datetime.date.today().isoformat()
103107
rel = chart_file.relative_to(REPO_ROOT).as_posix()
108+
alt = "نمودار مشارکت‌های کاربران؛ " + "، ".join(
109+
f"{name} {count}" for name, count in top_contribs
110+
)
104111
block = (
105112
f"{STATS_START}\n"
106113
"### مشارکت‌های کاربران\n"
107-
f"![مشارکت‌های کاربران]({rel})\n"
114+
f"![{alt}]({rel})\n"
108115
f"(به‌روزرسانی: {date_iso})\n"
109116
f"{STATS_END}"
110117
)
@@ -159,7 +166,7 @@ def main() -> None:
159166
print(f"Saved user contributions chart to {out_path}")
160167
plt.close()
161168

162-
refresh_readme(out_path, args.dry_run)
169+
refresh_readme(out_path, args.dry_run, data)
163170

164171

165172
if __name__ == "__main__":

0 commit comments

Comments
 (0)