mirror of
https://github.com/ankitects/anki.git
synced 2026-11-30 10:14:33 -06:00
## Linked issue Noted in https://github.com/ankitects/anki/pull/5105#pullrequestreview-4861060987 ## Summary RTL languages are tracked in two separate places (pylib/anki/lang.py:is_rtl and ts/lib/tslib/i18n/utils.ts:direction) but they are out of sync. ## Steps to reproduce (before) - Run with Uyghur set as language: `./run -l ug`. - Open the Deck Options screen and notice the page's direction is left-to-right. ## How to test (after) Confirm the Deck Options screen is displayed right-to-left for Uyghur. ### Checklist (minimum) - [x] I ran `./ninja check` or an equivalent relevant check locally. - [x] I added or updated tests when the change is non-trivial or behavior changed. ### Details A better solution is to keep a single list in the backend or detects the directionality of the locale name (see [example in AnkiDroid](https://github.com/ankidroid/Anki-Android/blob/eb22e1e6ad7e245d6fe34eceb75954792f6fe7ab/AnkiDroid/src/main/java/com/ichi2/anki/LanguageUtils.kt#L47)). Both requires moving anki.lang.langs to the backend, which I don't think is worth the effort. ## UI evidence ### Before <img width="1406" height="654" alt="image" src="https://github.com/user-attachments/assets/e9e8aa75-e6b1-4a27-85d5-cfda16c16314" /> ### After <img width="1425" height="777" alt="image" src="https://github.com/user-attachments/assets/48994c54-8209-4c6b-821e-c734c85e96e2" /> ## Scope - [x] This PR is focused on one change (no unrelated edits).