Forums | Mahara Community

Developers /
Right to Left Support


anonymous profile picture
Account deleted
Posts: 808

15 February 2011, 14:57

I'd forgotten about rtl.css, but yes, it's included last, so if you put a file with that name inside htdocs/theme/raw/static/style, anything you put in there will override what's in style.css.

anonymous profile picture
Account deleted
Posts: 41

15 February 2011, 18:13

yes, I noticed it overrides everything, I am currently doing RTL.css to correct the positioning of the buttons and other divs to work correctly in a RTL manner.

I worked according to your advice as a temporary solution; hopefully in the next major release these issues are solved

 

Thanks a lot

anonymous profile picture
Account deleted
Posts: 41

16 February 2011, 12:34

Hi Richard,

 

I have been working on the RTL style along side with translation, we have made some good progress but there are few problems I want to highlight maybe you can help me with:

1.      The navigation menus are oriented from LTR, I have to make them RTL for example Home comes last instead of first. Which file is response for rendering these menus and how can I control them.

 

2.      Exactly the same problem apply when the bottom navigation in a paged content display for example when create many views and there is a next, previous…etc bar it is displayed inverted, what are the files responsible to change their locations (I already changed the CSS responsible for them)

 

3.      For checkboxes they are also displayed inverted so labels are displayed before the check box.

 

4.      When you add task the calendar doesn’t get displayed at all and the page redirects you to my plans instead

 

5.      On My Blog, the buttons(Edit and Delete) do not show like they do in the LTR version (the delete button does not display as X image instead as button) I don’t know what is the problem.

 

These are the problems for now I hope I will be able to solve them soon, I hope you can highlight some tips regarding these problems or if you have encountered any issue like the ones I mentioned

 

One final request, can I get a demo database where you have every mahara feature running (if possible one like the one you are running in your demo site, because the translator I hired is not a technical person so I want him to fully understand what mahara is doing through this demo site, so we can end up with quality translation)

 

Sorry for consuming your time, all the best and thanks

 

Mohammad

 

anonymous profile picture
Account deleted
Posts: 808

16 February 2011, 17:40

For the navigation we need to fix it in core lib/web.php, but the easiest quick way for you might be to override the navigation.tpl template in your theme and reverse the navigation array in the places where it's being output, e.g. add '|reverse' so it looks like this:

{foreach from=$MAINNAV|reverse item=item}

The next, previous, etc. is not in a template unfortunately, it's html hardcoded in the build_pagination function (htdocs/lib/web.php), and I think we'll need to rewrite the function for rtl support.

The same goes for checkboxes and a lot of other form elements, exactly as Gregor mentioned below.  I'm not exactly sure fo the best way to fix it, but I think you might need to edit htdocs/lib/pieforms/pieform.php, and change the order in which the element and its label are output (see inside the build_element_html function).

The calendar stuff may be a problem with your language not being supported rather than rtl, because if I change en.utf8 to rtl and then click the calendar, it's still displayed.  Is there an arabic file in the htdocs/js/jscalendar/lang/ directory?  If not, we need to find one and add it.

I'm afraid I don't have a demo db with every mahara feature in use, but it would definitely be a good thing for someone to create and make available.

anonymous profile picture
Account deleted
Posts: 41

17 February 2011, 7:33

For the navigation problem I solved it already and its functioning correctly, all I had to do is to remove the {strip} from navigation.tpl.

I am working right now on the next-previous bar; I hope I will manage to solve it in the few next hours.

 

For the calendar it is now functional in Arabic I checked into pieforms.php but I didn’t manage to fully understand how the code is written, also I did not mange to find any online documentation about it. I hope you can highlight some issues about how it functions.

 

There is a major issue I couldn’t understand, when you save the file without changing the content using UTF8 encoding the whole theme get destroyed ( /htdocs/mahara/artifact/internal/lang/en.utf8) Please advice on these issues, so I can understand them and implement them on the remaining parts of Mahara, hopfully by the next Sunday we will have the whole Arabic translation along with RTL theme running. Thanks a lot for your help and sorry for the trouble

 

Best, Mohammad

Gregor Anželj's profile picture
Posts: 349

16 February 2011, 0:28

Maybe it is worth mentioning here. There may be problems with Pieforms, supporting RTL (or maybe I'm wrong?).

I mean: the text, textarea and select will work just fine (that is, they will support RTL), but there may be problems with checkbox and radio elements. I think they'll have to be changed/updated in order to correctly display RTL...

Somebody of Mahara Core Team correct me, if I'm wrong...

Regards,
Gregor

anonymous profile picture
Account deleted
Posts: 41

16 February 2011, 3:46

I think you are correct in for Pieforms, for example the HTML editor does not load when I am using RAW theme on RTL fashion but it works perfectly when it is on LFT mode. so I will do some work to try figure it out

 

Best,

Mohammad

 

 

 

 

 

 

 

 

anonymous profile picture
Account deleted
Posts: 41

17 February 2011, 7:35

Hello Gregor,

 

Can you please give me a brief about the pieforms, and how you knew about the issue and what are the possible solution in your point of view?

 

Thanks a lot,

Mohammad

 

Ruslan Kabalin's profile picture
Posts: 146

17 February 2011, 10:01

Mohammad,

For pieforms we have a so-called renderers that define how the pieform output will look like, it is defined in themeconfig.php file inside the theme directory:

$theme = new StdClass;

$theme->displayname  = 'Raw';
$theme->formrenderer = 'table';

You may create your own renderer (the avialable ones are in lib/pieforms/pieform/renderers) and apply it in your theme definition.

Regarding html editior, we already have 'thisdirection' parameter inside langconfig.php (htdocs/lang/xx.utf8/langconfig.php), which is not defined for english language by default. Setting it to 'rtl' is supposed to make html editior RTL-freindly.

By the way, tinyMCE settings in smarty function is the only place where 'thisdirection' parameter is used, perhaps we can use it more extensively where language direction should be respected.

Ruslan Kabalin's profile picture
Posts: 146

17 February 2011, 13:29

Another thing why html editor (tinyMCE) might not be loaded is the absence of its internal language files for the choosen Mahara language. Translation for tinyMCE is not maintained through mahara language packs, all relevant language files are inside htdocs/js/tinymce. For instance, you have created a new language pack ar.utf8, then when tinyMCE is inititated it will try to set "ar" language, if no relevant files are found in tinyMCE infrastructure, html editor will not be displayed. For the translation/testing purposes you may download missing language files from here  and unpack them to htdocs/js/tinymce. Once your language is ready the missing tinyMCE langiage bits will be added to the core Mahara package.