Adium

Ticket #651 (closed enhancement: fixed)

Opened 4 years ago

Last modified 2 years ago

Impoving Bidi-Support (Writing direction: Right-to-Left)

Reported by: transalpin Assigned to: ofri
Priority: high Milestone: Adium X 1.0
Component: Core Adium Version: 0.82
Severity: normal Keywords: writing direction, rtl, bidirectional, bidi, Arabic, Urdu, Farsi, Hebrew, Yiddish
Cc: Patch:
Pending:

Description

Proper display of text in a bidirectional language (such as Arabic, Urdu, Farsi, Hebrew or Yiddish) requires some <html dir="rtl"> behind the scenes in the html source of the conversation window. I’d like to suggest the implementation of a button and/or shortcut which turns both the content of the message window and the input field below (eg, the word processor Mellel uses ⌥⌘← for rtl and ⌥⌘→ for ltr respectively, but maybe you favor something else). The shortcut should work in a way that only in the currently active window the writing direction is switched. Please take into account that there is already an option in the context menu which currently only applies to the input field.

Change History

06/28/2005 02:07:53 PM changed by anonymous

  • severity changed from trivial to enhancement.
  • milestone changed from Adium X 0.83 to Adium X 0.90.

07/20/2005 04:15:37 PM changed by durin42

  • milestone changed from Adium X 0.90 (Old) to Adium X 1.0.

09/17/2005 05:38:17 PM changed by evands

  • owner changed from anybody to ofri.wolfus@gmail.com.

09/20/2005 04:56:36 PM changed by evands

(In [13519]) AITextAttributes can now encapsulate a writing direction. Refs #651

09/20/2005 04:58:33 PM changed by evands

(In [13520]) * Right-to-left text is now surrounded by a dir="rtl" div tag; dir="rtl" div tags are decoded back to right-to-left attributed strings. This fixes display of right-to-left text in the message view. Refs #651

  • A little cleanup of code elsewhere in the decoder

09/20/2005 05:05:01 PM changed by evands

(In [13521]) Merged [13519] and [13520]. Right-to-left text is now surrounded by a dir=rtl div tag; dir=rtl div tags are decoded back to right-to-left attributed strings. This fixes display of right-to-left text in the message view. Refs #651

10/08/2005 09:54:09 AM changed by ofri

(In [13708]) Preserve the writing direction when clearing the text view. Refs #651.

10/20/2005 11:30:26 AM changed by ofri

  • owner changed from ofri.wolfus@gmail.com to ofri.

We could make a pref for the default writing direction, and automatically align any outgoing/incomming messages according to it. Thoughts?

01/03/2006 05:01:06 AM changed by transalpin

I’d like to see the whole dialog switched, not just my own messages. The div wrapper doesn’t make sense, users need primarily proper display for received messages.

It shouldn’t be too difficult to change the html tag dynamically using java script. I’m thinking of something like document.getElementsByTagName("html")[0].dir="rtl"; Thank you!

07/24/2006 11:59:28 PM changed by tick

  • milestone changed from Adium X 1.1 to Sometime after 1.0.
  • field_haspatch changed.

I like that idea ofri. You assign this to a milestone once you have it commitable.

08/22/2006 06:45:14 AM changed by ofri

After reading some more about the subject, I see my solution is not ideal. Unicode has its own algorithm for determining the writing direction of text, so assuming we always have UTF-8, 16 or 32 (IIRC NSString uses UTF-32 internally) before sending/displaying, we can properly align and display it.
So what really needs to be done is implement the unicode's bidi algorithm (as a category to NSString or something), and then use it to add dir tags to the displayed text. Optionally, this could also be used for adding a direction property for protocols that support it (IIRC, MSN does).

08/23/2006 07:53:39 AM changed by ofri

(In [17458]) Adding FriBidi, the GNU implementation of the Unicode bidirectional algorithm, compiled as a standalone framework and linked to Adium.framework for AIHTMLDecoder's usage. Refs #651

08/23/2006 08:06:21 AM changed by ofri

  • milestone changed from Sometime after 1.0 to Adium X 1.0.

08/23/2006 08:10:13 AM changed by ofri

  • status changed from new to closed.
  • resolution set to fixed.

(In [17459]) AIHTMLDecoder now determines the writing direction based on the actual text of the message if possible, and only then falls back to the direction of the input field. Fixes #651

10/14/2006 05:14:57 PM changed by transalpin

Does that apply to both outgoing and incoming messages?