RTL Issue with Arabic in Dspace 5.4 XMLUI

202 views
Skip to first unread message

Shakir Khan

unread,
Jun 3, 2016, 6:12:03 AM6/3/16
to DSpace Technical Support
Hello Dear members
It is working with me Arabic support, my issue is that I want to call style_rtl.css for arabic support so that I can change the style for Arabic RTL.

I already added the following for language switcher and switching is working fine, my concern only to call different style_rtl.css for Arabic. I used classic theme of xmlui.

dspace\webapps\xmlui\themes\Mirage\lib\xsl\core\page-structure.xsl


 <div style=”margin-right:300px;direction:rtl”> language :: <a href=”/xmlui?locale-attribute=ar”> Arabic</a> | <a href=”/xmlui?locale-attribute=en”> English </a> </div>


Can anybody please help me what conditional code should I add for this and in which file?


Thanks in advance



Shakir Khan

unread,
Jun 3, 2016, 11:42:51 AM6/3/16
to DSpace Technical Support
Anybody help please....

Luiz dos Santos

unread,
Jun 3, 2016, 5:08:02 PM6/3/16
to Shakir Khan, DSpace Technical Support
Hi,

   I didn't get why are you editing the page-structure.xml, did you try to add webui.supported.locales = en, de, ar in the dspace.cfg?

Best regards
Luiz

--
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To post to this group, send email to dspac...@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Shakir Khan

unread,
Jun 3, 2016, 5:51:32 PM6/3/16
to Luiz dos Santos, DSpace Technical Support

​Dear Luiz
Thank you for your revert. I edited page-structure.XML just to switch
​ language because ​Arabic is RTL and how can I call style_rtl.css for the same funtionality. This is the copy of style.css. Yes I added webui.supported.locales = en, de, ar in the dspace.cfg? and its working fine but now just one problem to change RTL for Aabic. Without RTL its working fine. I followed this link https://amdmaher.wordpress.com/2013/08/16/add-another-language-to-dspace/ and it worked fine.
Kindly help me if you have better way for Arabic shifting RTL.

Luiz dos Santos

unread,
Jun 3, 2016, 7:31:48 PM6/3/16
to Shakir Khan, DSpace Technical Support
Hi Shakir,

   I really didn't get why Ahmad ask to change the page-structure.xsl, when you add the webui.supported.locales = en, de, ar in the dspace.cfg, DSpace will create the menu to you select the language, so I don't see the point to change it in the  page-structure.xsl.
   About the css, you should add it to the sitemap.xml of you theme, you should add the css, among the css, look the code below, of course I'm supposing that you have the default installation of DSpace 5.
<map:resource name="transform-to-xhtml">

    <!-- Add page metadata to DRI -->
    <!-- This adds all Stylesheets (CSS) and Javascript (js) into the DRI XML, 
         so that they are accessible to the XSLTs -->
    <!-- 3 different IncludePageMeta transformers to ensure that the
         stylesheets end up in the correct order-->
    <map:transform type="IncludePageMeta">
        <map:parameter name="stylesheet.screen#1" value="lib/css/reset.css"/>
        <map:parameter name="stylesheet.screen#2" value="lib/css/base.css"/>
        <map:parameter name="stylesheet.screen#3" value="lib/css/helper.css"/>
        <map:parameter name="stylesheet.screen#4" value="lib/css/jquery-ui-1.8.15.custom.css"/>
        <map:parameter name="stylesheet.screen#5" value="lib/css/style.css"/>
        <map:parameter name="stylesheet.screen#6" value="lib/css/authority-control.css"/>
    </map:transform>
    <map:transform type="IncludePageMeta">
        <map:parameter name="stylesheet.handheld" value="lib/css/handheld.css"/>
        <map:parameter name="stylesheet.print" value="lib/css/print.css"/>
    </map:transform>
    <map:transform type="IncludePageMeta">
        <map:parameter name="stylesheet.all" value="lib/css/media.css"/>
        <map:parameter name="javascript" value="lib/js/jquery-ui-1.8.15.custom.min.js"/>
        <map:parameter name="theme.path" value="{global:theme-path}"/>
        <map:parameter name="theme.name" value="{global:theme-path}"/>
        <map:parameter name="curRequestURI" value="{1}"/>
    </map:transform>
     One last thing, it is a good practice do not change the DSpace code files, instead, create a new file and directory structure in the module folder and it will replace the DSpace original file in the Build process.
Best
Luiz


Shakir Khan

unread,
Jun 3, 2016, 8:19:28 PM6/3/16
to Luiz dos Santos, DSpace Technical Support
Dear Lulz

Thank you fr your ind help and revert aand I removed that from page-structure.xml and still its working fine.. This is the dspace link which I am testing http://kwarim.biz/xmlui/?locale-attribute=ar, for locale-attribute=ar, I want to include style_rtl.css means want to call separate css for each language so that I can change style_rtl.css for RTL use.  I want to put the condition that rtl css should be called during Arabic and for English default style.css is fine to be called.
When I tried to call, it gives me error. Could you please help me to handle this situation for calling the different css for each language.



On Sat, Jun 4, 2016 at 2:31 AM, Luiz dos Santos <lui...@gmail.com> wrote:
Hi Shakir,

Luiz dos Santos

unread,
Jun 6, 2016, 10:40:27 AM6/6/16
to Shakir Khan, DSpace Technical Support
Hi Shakir,


    I thought in something like the code below, but I never tested, in deep, I'm not sure about how to select the locale, you could try it, or maybe somebody else in the list have a better idea.

<map:transform type="IncludePageMeta">
        <map:parameter name="stylesheet.screen#1" value="lib/css/reset.css"/>
        <map:parameter name="stylesheet.screen#2" value="lib/css/style.css"/>
        <map:parameter name="javascript#1" value="lib/jquery-1.2.min.js"/>
        <map:parameter name="javascript#2" value="lib/tamu-menus.js"/>
        <map:parameter name="theme.path" value="{global:theme-path}"/>
        <map:parameter name="theme.name" value="{global:theme-name}"/>

        <map:select type="parameter">
            <map:parameter name="parameter-selector-test" value="locale"/>
            <map:when test="ar">
                <map:parameter name="stylesheet.screen#5" value="lib/css/style_rtl.css"/>       
            </map:when>
            <map:otherwise>
             <map:parameter name="stylesheet.screen#5" value="lib/css/style.css"/>
            </map:otherwise>
         </map:select>        
         <map:parameter name="stylesheet.screen#6" value="lib/css/authority-control.css"/>
</map:transform>


Best
Luiz

Shakir Khan

unread,
Jun 6, 2016, 10:40:28 AM6/6/16
to Luiz dos Santos, DSpace Technical Support
Dear Luiz
Thanks a lot, the same is not working.

Anybody help please in selecting locale condition for each language.
--
Kind Regards
........................
Dr. Shakir Khan
Assistant Professor
Office: FR 196 | College of Computer and Information Sciences
Information Studies Department
Al-Imam University
Riyadh 11432 | Saudi Arabia
Off: +966.11.25.88611
Reply all
Reply to author
Forward
0 new messages