GNOME Bugzilla – Bug 688174
RTL languages (e.g. Hebrew) are no longer aligned to right
Last modified: 2013-01-04 09:50:42 UTC
Created attachment 228783 [details] empathy good and bad RTL pictures Previous versions were fine. Attached are correct RTL from previous version and current incorrect RTL layout.
Created attachment 228782 [details] empathy good and bad RTL PNG files
That's probably because we switched to Adium themes by default. Do you have this bug with any of the theme available in the preferences dialog?
*** Bug 679186 has been marked as a duplicate of this bug. ***
I have themes Boxes,Classic and Planet GNOME. None of these show Hebrew correctly now. The Boxes theme worked very well in the past, since text began in a new line. The Classic theme starts from left to right so it is less suited for Hebrew. The bubble theme (Planet GNOME) also doesn't align Hebrew correctly.
Actually, I know nothing about RTL and how it's supposed to work. Is the 'this text is RTL' information included in the UTF-8 string itself? If you paste a few Hebrew text here and I copy/paste it in Empathy, should I be able to reproduce this bug?
Interesting, Shell's chat bubble displays it correctly but empathy-chat does not. Also, Adiyum has a message direction setting that we don't set atm: http://git.gnome.org/browse/empathy/tree/libempathy-gtk/empathy-theme-adium.c#n591 Problem is, most IM protocol don't tell us if the text is LTR or RTL so we'll need some kind of heuristic which I have no idea how to implement.
My thinking was to enable users to use old themes (at least the old box ones) as they worked very well. Anyway, if I write some Hebrew text you should be able to see the issue yourself. I'll write a two word sentence here (meaning "hello everyone"): שלום לכולם. This sentence should appear from right to left with first word שלום and second לכולם followed by a dot. I see the text beginning from left to right with the dot appearing in the wrong position after sending, while it appears correctly in the writing box field before I click "enter" to send.
Created attachment 232713 [details] screenshot I think I have the start of a fix for this. The Stockholm theme ( http://www.adiumxtras.com/index.php?a=xtras&xtra_id=1760 ) implements the %messageDirection% keyword and this empathy branch does as well using pango_find_base_dir() to check if the message is RTL or not. http://cgit.collabora.com/git/user/cassidy/empathy/log/?h=rtl-688174 That seems to work fine, see screenshot. The last step would be to implement it in the default Empathy themes as well but that needs some CSS tweaks which are beyond my skills.
Created attachment 232715 [details] [review] theme-adium: implement %messageDirection% This seems to work fine with the Stockholm which implement this keyword.
Created attachment 232716 [details] [review] implement %messageDirection% in default themes
looks good to me, +1
Attachment 232715 [details] pushed as 0238337 - theme-adium: implement %messageDirection% Attachment 232716 [details] pushed as 0aa79ad - implement %messageDirection% in default themes
The picture in comment 8 does not display the sentence correctly as the dot is at the beginning of the sentence instead of at the end.