Bug 8061

Summary: Koha's templates do not cope well with right-to-left languages
Product: Koha Reporter: D Ruth Holloway <ruth>
Component: I18N/L10NAssignee: Karam Qubsi <karamqubsi>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: major    
Priority: P1 - high CC: chris, gaetan.boisson, karamqubsi, katrin.fischer
Version: Main   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10017
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Proposed patch
Proposed patch (Staff)
RTL css files 80% good
Right to left for staff Client
(staff) D.Ruth Patch to fit master
(Staff) Enhancement to D.Ruth Patch
(Opac-Prog) D.Ruth patch to fit master
Follw up (Opac-Prog) enhancment on D.Ruth work ..
[SIGNED-OFF] Bug 8061: RTL CSS overrides (staff client) This patch tweaks a few templates, and enables right-to-left flipping via CSS in the staff client
Bug 8061: Follow up - RTL CSS overrides (staff client) I think this patch is good for th rtl langs. and based on what D.Ruth send before , I added some edits as a right to left reader. Tested on master with Arabic I used the updated po files for v. 3.8 (b
[SIGNED-OFF] Bug 8061: RTL CSS overrides (staff client)
Bug 8061: Follow up - RTL CSS overrides (staff client)
[SIGNED-OFF] Bug 8061: RTL CSS overrides (OPAC)
Bug 8061: Follow Up (Opac-Prog) - enhancement to D Ruth's patch
Bug 8061: RTL CSS overrides (staff client)
Bug 8061: Follow up - RTL CSS overrides (staff client)
Bug 8061: RTL CSS overrides (OPAC)
Bug 8061: Follow up - RTL CSS overrides (staff client)
Bug 8061: RTL CSS overrides (staff client)
Bug 8061: RTL CSS overrides (OPAC)
Bug 8061: Follow up - RTL CSS overrides (staff client)
Bug 8061: Follow up - RTL CSS overrides (staff client)
Bug 8061: Follow Up (Opac-Prog) - enhancement to D Ruth's patch
[PASSED QA] Bug 8061: RTL CSS overrides (staff client)
[PASSED QA] Bug 8061: RTL CSS overrides (OPAC)
[PASSED QA] Bug 8061: Follow up - RTL CSS overrides (staff client)
[PASSED QA] Bug 8061: Follow Up (Opac-Prog) - enhancement to D Ruth's patch
OPAC-CCSR-Right-to-left-css

Description D Ruth Holloway 2012-05-09 08:34:05 UTC
The current codes add "dir='rtl'" to the template's <HTML> tag if the languages is defined as right-to-left, in the language_script_bidi table, which is a good start, but the templates contain many floats and text-aligns in the CSS that make actual layout of the pages thoroughly nonsensical for RTL readers.

Separate patches for OPAC and Staff, coming soon!
Comment 1 D Ruth Holloway 2012-05-09 08:43:33 UTC Comment hidden (obsolete)
Comment 2 Jared Camins-Esakov 2012-05-09 13:22:00 UTC
I have noticed a few issues with this patch.

The layout is wrong for the opac-privacy.pl page, as well as in the language chooser at the bottom:
http://screencast.com/t/OQumB19gm

I don't like the layout for the opac-messaging.pl, though if native speakers find it acceptable, I am prepared to sign off on it as is (notice the table on the right and the heading on the left):
http://screencast.com/t/8Yg94tzAWy

There's a similar table layout problem on the suggestions page.

On the details page there are a two problems that jump out. 1) The items table is right-justified but the tabs are left-justified. 2) The search pager buttons are backwards. Next is on the right, and previous is on the left, but the arrows are pointing left and right, respectively:
http://screencast.com/t/g0G4Ly9l

On the advanced search page, the alignment for the search boxes at the top is off:
http://www.screencast.com/t/qpGlVCukVpcx

This definitely represents a huge improvement, though. Well done!
Comment 3 D Ruth Holloway 2012-05-15 05:58:53 UTC Comment hidden (obsolete)
Comment 4 Chris Cormack 2012-06-01 22:57:46 UTC
Hi Ruth

Unfortunately the first patch no longer applies

Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt
CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/prog/en/modules/opac-review.tt
Auto-merging koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt
CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/prog/en/modules/opac-addbybiblionumber.tt
Auto-merging koha-tmpl/opac-tmpl/prog/en/includes/doc-head-close.inc
Auto-merging koha-tmpl/opac-tmpl/prog/en/css/opac.css
Failed to merge in the changes.
Patch failed at 0001 Bug 8061: RTL CSS overrides (OPAC)

The second one conflicts too

Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc
Failed to merge in the changes.
Comment 5 Karam Qubsi 2012-10-27 22:31:59 UTC
I fell like there is some problems facing us to apply rtl direction by default when using on of the rtl languages

when I'm trying to set the css files i found that there is some styles cannot be changed from css files only so this is a problem for example : 

/usr/share/koha/opac/htdocs/opac-tmpl/prog/en/includes/opac-bottom.inc

you can see : 

    [% IF ( languages_loop && opaclanguagesdisplay ) %]
        [% UNLESS ( one_language_enabled ) %]
            <div id="changelanguage" class="ft">
            <div class="lang" style="float:left;padding: 0.1em 0;"><strong>Languages:&nbsp;</strong></div>

Floats and this will make the general css files not effect on this file

I fix this by hand but I think this must be not here and all the styles must be just in the css files to make it easier in changing the direction to rtl 

i don't have experience in patching but I hope if some one can guide me how to test your patch 

I have rtl css files make koha about 80% good in rtl but need some debugging I will attach it here .
Comment 6 Karam Qubsi 2012-10-27 22:58:36 UTC Comment hidden (obsolete)
Comment 7 Karam Qubsi 2013-03-25 10:55:35 UTC
I wish this will be solved in the next koha release 3.12 .
Comment 8 Katrin Fischer 2013-03-25 12:18:11 UTC
Hi Karam,

the patches attached here currently no longer apply. We need someone to take a look at them and rebase them on current master. Maybe it coudl be done in smaller steps/patches.
Comment 9 Karam Qubsi 2013-04-04 02:13:18 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2013-04-04 14:50:10 UTC
Hi Karam,

thx for working on this. :)

Just a few short notes to move this in the right direction (into Koha):
- Is your new patch for master or 3.8?
- Is it based on Ruth's patch? In this case it would be better if you could provide a follow up with your changes, so that you both can get proper credit for the work that has gone into this. If you need help with git, I am sure we can work something out.

If we could get a patch ready for 3.12 in the next few weeks, that would be quite nice!
Comment 11 Katrin Fischer 2013-04-05 06:25:33 UTC
Karam told me that his patch is based on master - so this is good. Not sure if we should just handle it as a rebase and Karam's work as a sign-off?
Comment 12 Karam Qubsi 2013-04-05 10:24:10 UTC Comment hidden (obsolete)
Comment 13 Karam Qubsi 2013-04-05 10:27:43 UTC Comment hidden (obsolete)
Comment 14 Karam Qubsi 2013-04-05 10:29:18 UTC
Hi Katrin I hop this will solve the problem ^_^ .

Best regards 
Karam.
Comment 15 Katrin Fischer 2013-04-05 10:32:20 UTC
Karam++ :)
Comment 16 Karam Qubsi 2013-04-06 09:30:46 UTC Comment hidden (obsolete)
Comment 17 Karam Qubsi 2013-04-06 09:34:31 UTC Comment hidden (obsolete)
Comment 18 Katrin Fischer 2013-04-07 08:18:47 UTC Comment hidden (obsolete)
Comment 19 Katrin Fischer 2013-04-07 08:19:06 UTC Comment hidden (obsolete)
Comment 20 Katrin Fischer 2013-04-07 08:22:00 UTC Comment hidden (obsolete)
Comment 21 Katrin Fischer 2013-04-07 08:22:11 UTC Comment hidden (obsolete)
Comment 22 Katrin Fischer 2013-04-07 08:22:19 UTC Comment hidden (obsolete)
Comment 23 Katrin Fischer 2013-04-07 08:22:28 UTC Comment hidden (obsolete)
Comment 24 Katrin Fischer 2013-04-07 08:23:37 UTC
These patches are now waiting for sign offs on the follow-ups Karam did.
Comment 25 Chris Cormack 2013-04-07 08:50:12 UTC Comment hidden (obsolete)
Comment 26 Chris Cormack 2013-04-07 08:50:32 UTC Comment hidden (obsolete)
Comment 27 Chris Cormack 2013-04-07 08:50:52 UTC Comment hidden (obsolete)
Comment 28 Chris Cormack 2013-04-07 08:51:38 UTC Comment hidden (obsolete)
Comment 29 Chris Cormack 2013-04-07 09:09:21 UTC Comment hidden (obsolete)
Comment 30 Chris Cormack 2013-04-07 09:12:31 UTC Comment hidden (obsolete)
Comment 31 Chris Cormack 2013-04-07 09:13:25 UTC Comment hidden (obsolete)
Comment 32 Chris Cormack 2013-04-07 09:18:56 UTC Comment hidden (obsolete)
Comment 33 Chris Cormack 2013-04-07 09:19:52 UTC Comment hidden (obsolete)
Comment 34 Katrin Fischer 2013-04-07 10:08:52 UTC
Created attachment 17246 [details] [review]
[PASSED QA] Bug 8061: RTL CSS overrides (staff client)

This patch tweaks a few templates, and enables right-to-left
flipping via CSS in the staff client.

Signed-off-by: Karam Qubsi <karamqubsi@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Amended patch, putting back author and adding sign off.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with Arabic po files from 3.8.
All tests and QA script pass.
Comment 35 Katrin Fischer 2013-04-07 10:09:17 UTC
Created attachment 17247 [details] [review]
[PASSED QA] Bug 8061: RTL CSS overrides (OPAC)

This patch repairs a few things in templates and CSS to allow
for the injection of right-to-left CSS, also in this patch.
It should apply to 3.8 and master.

To test, install and enable a right-to-left language for the
OPAC, currently Hebrew or Arabic.
The Arabic OPAC translations for 3.6 are mostly-complete, so
they are a good test case.

It's helpful to have a reader of the language handy, but the
layout should be easy enough to figure out, even for
non-readers.

Signed-off-by: Karam Qubsi <karamqubsi@gmail.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Amended patch adding back author and adding sign off.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 36 Katrin Fischer 2013-04-07 10:09:30 UTC
Created attachment 17248 [details] [review]
[PASSED QA] Bug 8061: Follow up - RTL CSS overrides (staff client)

I think this patch is good for th rtl langs.
and based on what D.Ruth send before, I added some edits
as a right to left reader.

Tested on master with Arabic
I used the updated po files for v. 3.8 (because the 3.12 )
need some revision ...

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Comment 37 Katrin Fischer 2013-04-07 10:10:19 UTC
Created attachment 17249 [details] [review]
[PASSED QA] Bug 8061: Follow Up (Opac-Prog) - enhancement to D Ruth's patch

In this Patch I added some changes to the rtl.css file
I made some changes in the file opac-bottom.inc and add css
classes to the lang list and I define the class value in
the opac.css
I add If statment to the opac-detail.tt to chose the rtl.css
when rtl lang.

http://bugs.koha-community.org/show_bug.cgi?id=8061

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Reformatted commit message and added bug number.

Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Tested with po files for Arabic from 3.8.
All tests and QA script pass.
Comment 38 Jared Camins-Esakov 2013-04-07 16:53:14 UTC
This patch has been pushed to master and 3.12.x.
Comment 39 Karam Qubsi 2013-04-08 12:40:29 UTC Comment hidden (obsolete)
Comment 40 Karam Qubsi 2013-04-09 19:57:51 UTC
I reported a new bug for the ccsr
so the : 
 OPAC-CCSR-Right-to-left-css (11.00 KB, patch) 
is obsoleted
the new bug . 

http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10017