Persian figure labels in numba.md are unshaped and reversed — matplotlib does no Arabic shaping or bidi
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 48/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- python
- Domaine
- data-visualization, internationalization
Piste de recherche
Commencez par les lignes 820-822 de numba.md et environment.yml, puis examinez comment les autres éditions traduites gèrent les libellés de figures non latins. Comparez les dépendances de shaping proposées avec les options par libellé, via un helper et d’évitement du texte ; le travail est considéré comme terminé lorsque le projet dispose d’une décision testée et documentée et que les libellés en persan s’affichent correctement si le shaping est adopté.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
numba.md sets Persian text on matplotlib figures — ax.set_xlabel('تعداد نمونهها') at line 820 and ax.set_ylabel(r'تخمین $\pi$') at 822, introduced by sync commit 7cd985b — and this repo carries no matplotlib font configuration and no font assets at all.
This is not the same problem as the Chinese editions, and it must not get the same fix. The glyphs do render: DejaVu Sans, matplotlib's default, covers all 29 codepoints involved. What fails is shaping. matplotlib performs no Arabic contextual shaping and no bidirectional reordering, so the label comes out as isolated letterforms in left-to-right order — legible as individual characters, wrong as Persian text. Swapping in a Persian font would not help, because the defect is in the text-layout stage rather than in glyph coverage.
Fix
The conventional approach is to reshape and reorder the string before it reaches matplotlib:
arabic-reshaperto apply contextual formspython-bidito apply the Unicode bidirectional algorithm
Both would need adding to environment.yml. Worth deciding whether to apply this per-label, via a small helper, or to avoid Persian in figure text altogether for now — the third option is legitimate and is what the rest of this edition currently does by default.
How it was found
A survey of CJK font handling across the translation program (project-translation reports/2026-07-24-cjk-font-rendering-review.md) checked the non-Latin editions for the same class of defect. This is the only instance in .fa; the .fr edition needs nothing, since DejaVu covers Latin with accents and French needs no shaping.
Filed for a decision rather than as an urgent break — one lecture, and the text is present rather than absent.
- Langage dominant
- Python
- Étoiles
- 1
- Forks
- 1
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de QuantEcon/lecture-python-programming.fa
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Run translation sync check against source repoPeut-être à nouveau libre @mmcky l’a pris il y a 174 jours, et aucune pull request n’est ouverte. Ouverte
QuantEcon/lecture-python-programming.fa#106 · 1 personne assignée ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
Toutes les issues de QuantEcon/lecture-python-programming.fa
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
FuRongJun-1999/dsh-memory#56 ·
Les mainteneurs répondent en général sous 1 jour
-
Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
pgadmin-org/pgadmin4#10503 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 85/100
521xueweihan/HelloGitHub#3857 ·
-
needs-ac
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Ikalus1988/MisakaNet#2845 ·
Les mainteneurs répondent en général sous 1 jour
-
bug connectors operations
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
pyinfra-dev/pyinfra#1989 ·
Les mainteneurs répondent en général sous 3 jours