Project

General

Profile

Actions

Bug #683

closed

display of WTreeView in Right to left languages

Added by Momo LALMI about 13 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
-
Start date:
01/13/2011
Due date:
% Done:

0%

Estimated time:

Description

Hello,

The following languages are written from right to left : Arabic, Hebrew, Mandekan, Syriac, Thaana/Thâna, Tifinar, Urdu

To support right to left languages I am doing the following :

if ( rightToLeftLanguage )

{

WApplication::instance()->styleSheet().addRule("html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img,

ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, fieldset, form, label, legend, table, caption, td, tr, li",

"direction:rtl;");

WApplication::instance()->styleSheet().addRule("html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img,

ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, fieldset, form, label, legend, table, caption, td, tr, li ",

"text-align:right;");

}

else

{

// normal case : left to write language

}

This is working for most Wt Elements : WBoxLayout , WTable, etc

But there is no way to display WTreeView correctly in these RTL languages :(

Could you take a look on this issue please ?

Best regards


Files

WTreeView_English1.png (140 KB) WTreeView_English1.png Momo LALMI, 01/13/2011 06:31 PM
WTreeView_English2.png (196 KB) WTreeView_English2.png Momo LALMI, 01/13/2011 06:31 PM
WTreeView_Arabic1.png (106 KB) WTreeView_Arabic1.png Momo LALMI, 01/13/2011 06:31 PM
WTreeView_Arabic2.png (158 KB) WTreeView_Arabic2.png Momo LALMI, 01/13/2011 06:31 PM
Actions #1

Updated by Wim Dumon about 13 years ago

Mohamed,

Can you tell us what it looks like now, and what it should look like if done correctly? Unfortunately, we're not fluent in any of those languages. Images would help!

Wim.

Updated by Momo LALMI about 13 years ago

Hello Wim,

Thank you very much for taking this issue into account :

So this is a resume of what a WTreeView contains in "normal" languages (left to right):

____________________________________________________________________________________
COLUMN 1 (FIXED) | COLUMN 2 | COLUMN 3 | COLUMN 4 | COLUMN 5 | COLUMN 6 | COLUMN 7 |
____________________________________________________________________________________ 

and the following is what should be displayed in a right to left language :

___________________________________________________________________________________ 
COLUMN 7 | COLUMN 6 | COLUMN 5 | COLUMN 4 | COLUMN 3 | COLUMN 2 | COLUMN 1 (FIXED |
___________________________________________________________________________________ 

please see attached 4 images : 2 images in english and 2 in arabic ( some columns where simply dropped with my method (applying the style sheet rules : text-align:right; direction:rtl;)

Actions #3

Updated by Koen Deforche about 13 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche

Hey Mohamed,

I'm working on this and have progressed alot. I am now in doubt however how much of the UI needs to be reversed.

E.g. in the header row, should the location of the sort and resize handles also reverse ?

Regards,

koen

Actions #4

Updated by Momo LALMI about 13 years ago

thanks a lot , support for right to left languages was really missing in WT :)

the location of the sort sould be also reversed.

the resize handle of a column should be displayed at the left side of that column :)

Actions #5

Updated by Momo LALMI about 13 years ago

Hi Koen,

May be you can add to WApplication an additional property : languange_direction or direction fixed by default to LeftToRioght and apply the stylesheet rules whenever the direction changes.

Actions #6

Updated by Koen Deforche about 13 years ago

  • Status changed from InProgress to Resolved

Hey, I've come a long way with the implementation, see latest git (WApplication::setLayoutDirection()).

Please let me know what is still missing ?

Actions #7

Updated by Momo LALMI about 13 years ago

Hi Koen,

When WTreeView has Column 1 Fixed it is displayed in a strange manner (header's text is not visible, ....etc ) :)

When column 1 is not fixed everything goes fine :)

and everything is working fine with all other elements ( layouts , WTable , ....... )

Actions #8

Updated by Koen Deforche about 13 years ago

Hey Mohammed,

Should be fixed now in git. I do notice some weird behaviour with offset calculations in some browsers ...

And I also noticed that Firefox 4 entirely messes up dir=RTL...

Regards,

koen

Actions #9

Updated by Momo LALMI about 13 years ago

Hi Koen,

Thank you very much for this great work :)

some minor changes might be required on some browsers :)

- GOOGLE CHROME : Everything is OK ( LTR languages and RTL languages )

- APPLE SAFARI : Everything is OK

- INTERNET EXPLORER 9 : if WTreeWiew has column1 fixed : the horizontal scroll bar should moved a little to the left in RTL languages

- FIREFOX : pains to show the horizontal scrollbar of WTreeView when column 1 is fixed

  • OPERA 11 : like FireFox : it pains to show the horizontal scrollbar and seems to stack some columns

thanks again for supporting right to left languages :)

Actions #10

Updated by Koen Deforche about 13 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF