After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 688174 - RTL languages (e.g. Hebrew) are no longer aligned to right
RTL languages (e.g. Hebrew) are no longer aligned to right
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Chat themes
3.6.x
Other Linux
: Normal normal
: ---
Assigned To: empathy-maint
empathy-maint
: 679186 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-11-12 15:22 UTC by alonivtsan
Modified: 2013-01-04 09:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
empathy good and bad RTL PNG files (90.00 KB, application/x-compressed-tar)
2012-11-12 15:29 UTC, alonivtsan
  Details
empathy good and bad RTL pictures (79.57 KB, application/zip)
2012-11-12 15:22 UTC, alonivtsan
  Details
screenshot (19.76 KB, image/png)
2013-01-04 09:10 UTC, Guillaume Desmottes
  Details
theme-adium: implement %messageDirection% (4.10 KB, patch)
2013-01-04 09:40 UTC, Guillaume Desmottes
committed Details | Review
implement %messageDirection% in default themes (3.48 KB, patch)
2013-01-04 09:41 UTC, Guillaume Desmottes
committed Details | Review

Description alonivtsan 2012-11-12 15:22:40 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.
Comment 1 alonivtsan 2012-11-12 15:29:25 UTC
Created attachment 228782 [details]
empathy good and bad RTL PNG files
Comment 2 Guillaume Desmottes 2013-01-02 15:35:14 UTC
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?
Comment 3 Guillaume Desmottes 2013-01-02 15:35:25 UTC
*** Bug 679186 has been marked as a duplicate of this bug. ***
Comment 4 alonivtsan 2013-01-02 18:02:01 UTC
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.
Comment 5 Guillaume Desmottes 2013-01-03 10:38:53 UTC
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?
Comment 6 Guillaume Desmottes 2013-01-03 11:02:34 UTC
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.
Comment 7 alonivtsan 2013-01-03 15:50:57 UTC
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.
Comment 8 Guillaume Desmottes 2013-01-04 09:10:22 UTC
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.
Comment 9 Guillaume Desmottes 2013-01-04 09:40:57 UTC
Created attachment 232715 [details] [review]
theme-adium: implement %messageDirection%

This seems to work fine with the Stockholm which implement this keyword.
Comment 10 Guillaume Desmottes 2013-01-04 09:41:00 UTC
Created attachment 232716 [details] [review]
implement %messageDirection% in default themes
Comment 11 Xavier Claessens 2013-01-04 09:43:25 UTC
looks good to me, +1
Comment 12 Guillaume Desmottes 2013-01-04 09:50:02 UTC
Attachment 232715 [details] pushed as 0238337 - theme-adium: implement %messageDirection%
Attachment 232716 [details] pushed as 0aa79ad - implement %messageDirection% in default themes
Comment 13 alonivtsan 2013-01-04 09:50:42 UTC
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.