Skip to content

Conversation

@MoamenAbdelsattar
Copy link

Purpose / Description

Currently, the direction in which a card is rendered is not stable by default. If the UI of Ankidroid is English, text direction is left-to-right by default. If the UI of Ankidroidis Arabic, text direction is right-to-left by default. Although this can be changed from the settings (changing css for example), the card direction should be stable by default, being viewed in the same way regardless of the direction of the UI.

Fixes

This commit makes the direction of cards stable, regardless of the UI language.

Approach

This commit attempts to solve the issue by adding dir="auto" by default for all cards. It will not break existing cards that override the direction via css or html, but it will make cards that don't specify a direction stable.

How Has This Been Tested?

I haven't built Ankidroid, but I tested adding this attribute to card template front and back and it worked correctly, making the card direction stable regardless of the UI language.

@welcome
Copy link

welcome bot commented Nov 13, 2025

First PR! 🚀 We sincerely appreciate that you have taken the time to propose a change to AnkiDroid! Please have patience with us as we are all volunteers - we will get to this as soon as possible.

@david-allison
Copy link
Member

david-allison commented Nov 13, 2025

Thanks!!

This would need to be handled upstream so we don't deviate from how Anki Desktop renders cards.

Ideally make an issue, or a message on this PR with evidence that we're currently not matching Anki Desktop

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Nov 13, 2025
Copy link
Member

@mikehardy mikehardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi there 👋 - quick question - how does Anki Desktop handle this same case?

@MoamenAbdelsattar
Copy link
Author

I tested Anki desktop and found it has the same issue (card direction depends on the UI language). I made a PR there:
ankitects/anki#4428

@mikehardy
Copy link
Member

Excellent - FWIW, this looks to me like an obviously good idea, I just want to make sure we behave the same as Desktop, no one likes surprising differences between the platforms. If upstream agrees it is a good idea and merges we can do the same here pretty much immediately. Cheers

@mikehardy mikehardy added upstream-issue Anki Ecosystem Compatibility Blocked by dependency Currently blocked by some other dependent / related change and removed Needs Author Reply Waiting for a reply from the original author labels Nov 14, 2025
@david-allison
Copy link
Member

Thanks!!!! Closing this until upstream's fix is accepted.

Feel free to ping or reopen this at that point.

(I'm happy to take responsibility for getting this merged, since I'm responsible for the decision to close it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants