mirukana / mirage

A fancy, customizable, keyboard-operable Qt/QML & Python Matrix chat client for encrypted and decentralized communication.
GNU Lesser General Public License v3.0
412 stars 40 forks source link

Right-to-left support #137

Open hashashini opened 4 years ago

hashashini commented 4 years ago

One of my contacts played around with the display name and (on element-android) changed it to something (probably beginning) with arabic letters. Now in mirage 0.6.4 via flatpak on ubuntu 20.04.1/vanilla-gnome in a (encrypted) direct chat the contact's display name is unexpectedly displayed aligned to the right. The profile picture is displayed aligned to the left as usual and as expected. The "boxes" are correctly aligned (to the left), too, but the contact's display name is no longer displayed within the box's boundaries. I suppose it's because of arabic being written from right to left. If so I see two alternatives:

If we come to the conclusion that we run in a RTL environment mirror the current displaying behaviour on the central y-axis, i.e. display contact's messages aligned to the right and own messages aligned to the left. or Always use the same layout regardless of LTR/RTL, i.e. display contact's messages aligned to the left and own messages aligned to the right.

But either way we should only take into account mirage's own environment and not the environment of arbitrary contacts, i.e. if my contacts write to me in a RTL language from a RTL environment this shouldn't affect how the conversation is displayed to me.

This issue also affects the alignment of the contact's first message of a day and the contact's first response to messages, they are also aligned to the right and out of bounds.

mirukana commented 4 years ago

The profile picture is displayed aligned to the left as usual and as expected. The "boxes" are correctly aligned (to the left), too, but the contact's display name is no longer displayed within the box's boundaries.

Fixed this in 037abcc4f478dd7f815464a46fe497591f6810cb.

Some more work is needed to support running Mirage in RTL mode, but should we allow it when the UI is currently all English? Or should it be restricted to future RTL language translations?

hashashini commented 4 years ago

Thank you very much! Mirage is currently clearly the best GUI matrix client available. :)

In the spirit of KISS I don't think it's necessary to take any further action now. (RTL support currently doesn't affect me personally though.)

But I read about difficulties with RTL support before, so it might be a good idea to consider it early.