Edgewall Software
Modify

Opened 14 years ago

Last modified 14 years ago

#9045 new enhancement

Add support for RTL languages

Reported by: Christian Boos Owned by:
Priority: normal Milestone: translations
Component: i18n Version: 0.12dev
Severity: major Keywords: rtl
Cc: itamarost@…, jun66j5@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

This will be useful for e.g. Hebrew (#9040).

We need to add the possibility to reverse some parts of the layout. Changing the base direction (<html dir="rtl">) is a first step, but seems to be far from enough.

Maybe one approach could be to add some CSS classes the containers that need to have their content reversed and have a Genshi filter to do the job?

left/right should also be exchanged in the CSS, where relevant. Some techniques for achieving this are described in http://whatsup.org.il/meir/talks/django-i18n/django-i18n.html.

Some more background info in http://www.w3.org/International/tutorials/bidi-xhtml.

Attachments (1)

GmailBidi.png (23.9 KB ) - added by Itamar O <itamarost@…> 14 years ago.
Bidi support in Gmail rich-text editor

Download all attachments as: .zip

Change History (6)

comment:1 by Itamar O <itamarost@…>, 14 years ago

Cc: itamarost@… added

Adding self to Cc.

comment:2 by Christian Boos, 14 years ago

Keywords: rtl added
Milestone: 2.0translations

See also #1726.

by Itamar O <itamarost@…>, 14 years ago

Attachment: GmailBidi.png added

Bidi support in Gmail rich-text editor

comment:3 by Itamar O <itamarost@…>, 14 years ago

Another reference - The Unicode Bidirectional Algorithm: http://www.unicode.org/reports/tr9/

Relevant ticket on trac-hacks on RTL-support in Wysiwyg plugin: http://trac-hacks.org/ticket/6164

As I commented on the trac-hacks ticket, good RTL-support is very important for my organization, and I am interested in contributing to this purpose. I am able to set up Trac development environment (currently on Windows with Eclipse Pydev), and I would appreciate some assistance from core developers (or anyone else for that matter) on where to start and how to go about implementing such a thing.

Some thoughts I have on the issue, from the viewpoint of a bidirectional user:

Editing is a painful issue in the current state of affairs. When writing bidi-text, the user is forced to use plaintext editing (see the Wysiwyg plugin ticket on that issue):

  • then begins the guessing game (e.g. "where should I put the cursor if I want to insert text between these words?", or "what region should I *try* to mark if I actually intend to mark *that*?")
  • and the reverse engineering (how am I going to construct that paragraph so I comes out as I initially intended?).
  • I have attached a screenshot of the Gmail rich-text-editor as an example of a web-based textarea with good bidi-handling: Bidi support in Gmail rich-text editor
  • I must wonder — is this behavior browser-specific? (I'm using Firefox)

Display is probably the "main issue":

  • currently, to produce RTL output we use this method:
    {{{
    #!div dir="rtl"
    my right-to-left-content goes here
    }}}
    and some left-to-right content goes here
    
    leaving aside the fact that the need to use this markup is difficult for non-technical users, it prevents using the Wysiwyg plugin, and still does not provide good enough output.
  • RTL support will be needed even when the selected Trac-wide language is not RTL-script (I prefer the English user interface but want to be able to read RTL-formatted pages).
  • When RTL-script is chosen as Trac-wide language, it should be "smart" enough to keep LTR formatting where appropriate (e.g. think about the TOC plugin: the TOC box should float on the left for RTL pages and on the right for LTR pages, regardless of the chosen script).
  • The Trac admin should be able to set a default directionality for created pages, and the users should be able to override the default directionality within their sessions.
  • As in the Gmail example, the directionality should be settable per-paragraph.
  • Given the above, probably setting the top level <html dir="rtl"> depending on user-chosen-language does not suffice, as it might mess pages that are LTR.
  • The directionality should probably be an attribute of render-able resources (e.g. wiki page & paragraph, navbar, ticket description, ticket comment, changeset comment, query & report, …), with child-resources inheriting from parents unless overridden.

(sorry for the long comment…)

comment:4 by Jun Omae <jun66j5@…>, 14 years ago

Cc: jun66j5@… added

comment:5 by shesek, 14 years ago

CSSJanus does a pretty good job at RTL-ing CSS. I don't think it'll get it 100% right, but its much easier continuing from there. See also Google's post about that.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.