RTL Sakai

Back in Sakai 2.0 I went through an attempt to serve up a Right To Left language Sakai experience. At the time this was just an academic exercise, as there were no language resource bundles for Arabic, Hebrew, Farsi, etc. I just wanted to torture test the framework, frankly. It was amazingly simple to modify the portal framework via the skin to serve up an adequate portal. The tools were a different matter altogether, being so varied, and represented a number of challenges.

Now there is a Arabic translation (in trunk), so I thought I would go through the process again and hope it is useful. The framework has changed substantially also, so it was due. In this post I will outline the steps to turn a LTR portal (the Michigan CTools) into a RTL portal for some hypothetical university where Arabic is the main language. Disclaimer: I took Arabic in college, but it is long forgotten – so I am relying on random boilerplate and on iGoogle’s translator service for example strings. Don’t read too much into it!

In a future post I will go through one or two tools in a similar fashion.

  1. Use trunk. Add ‘ar’ to the locales attribute in sakai.properties, start tomcat.
  2. Login as admin. Create a user, give him a RTL name. In this case I used داود سيلڤَر (with a Latin id if you are not a RTL speaker, I used daud).
  3. We will want داود to mess around with tools as ‘mantain’ to get the full experience so create a site and add him as mantain. I used boilerplate Arabic for site title and description.
  4. Login as ‘daud’
  5. Change your Preferences > Locales to ‘Arabic’
Tada! First impressions – neat! Second impression – I cannot read it, it is too small. We will address that later.

First thing – let’s add a direction attribute to first child of the portal body:

#portalOuterContainer{
	direction: rtl;
}

This gets us started. All HTML elements that inherit this attribute and use it will reverse direction. Now we need to address the elements that are not affected.

Some things will need to be addressed substantially: 1) the orientation of the mast head needs to be fixed so that from RTL: logo, banner, login; 2) site list orientation; 3) the portlet title (Announcements) also needs to be reconfigured as well; 4) finally – the portal content needs to be from RTL: tool links, content.

Reorienting the mast head

We have this mess to contend with:

I have outlined the three components in red. From LTR: #mastLogo, #mastBanner, #mastLogin. They are all floated. We need to reverse the order, so let’s reverse the float:

#mastLogin{
  /*float:right*/ float:left
}
#mastBanner{
  /*float:left*/float:right
}

That is it – really. Am omitting all of the other attributes. Which gives us:

The order of labels and inputs is following the direction attribute of the body. Everything else needs work. Am going to hide #mastLogo because we do not need it. Any graphic element can be poked in as a background of any of the (embarrassingly numerous) other canvases available. I will also add different logos and background colors.

So – new image for banner_inst.gif and reverse the padding orientation on #mastLogin:

#mastLogin{
	float: left;
	text-align: right;
	/*padding-right: 15px;*/padding-left: 15px;
	vertical-align: top;
}

Which leaves us with:

The language bundle seems to be missing the Arabic equivalents for the input labels, but the position basics are in place: logo to the right, login to the left.

Reorienting the site navigation

We are left with:

Swapping the floats (links and select) reflect the importance of the 2 in the RTL context:

#linkNav{
	/*float:right*/ float:left
}
#selectNav{
	/*float:left;*/ float:right
}
So (am hiding the banner_inst.gif image):

Although the the direction:rtl in the body gets us the RTL select, it does not flip the orientation of the inline list that the site links are, a list is a list and has an order. We will need to be more devious…

#siteLinkList li{
	display: inline;
	float:right;
}
Yay – the order of importance reflected in the original LTR is now reflected in the RTL context: My Workspace, sites, other sites. Some minor touches are still needed such as the separators between site links, padding, etc.

Reorienting the content

The site content consists of a container (imaginatively id’d as #container), with two children: #toolMenuWrap (the tool link upper parent) and #content. Again , we have to tinker with the float of one:
#toolMenuWrap {
     border-right:2px solid #FFFFFF;
     color:#000000;
     /*float:left;*/ float:right
     padding:0 0.5em 0 0;
     text-align:right;
     width:9.6em;
}

and the margin of the other

#content{
	padding: 0;
	margin-top: .5em;
	/*margin-left: 11em;*/ margin-right: 11em;
}

and the text-align of the #toolMenu list items:

#toolMenu li{
	margin: 0;
	width: auto;
	padding: 0;
	border: 1px solid #fff;
	/*text-align: left;*/text-align: right;
}

Not bad, although quite a bit of clean up left to do (the presence block, the portlet titles (which are in the portal doc of all things) for example, the footers, etc.) And being ignorant of the actual use and needs, quite a few things I have overlooked as well – do leave comments setting me straight. I will upload the finished skin later. I will also address soon the skinning of the tools (gulp).

Advertisements

3 Responses to RTL Sakai

  1. […] Sakai from portal to tools Some things we left disheveled in a previous post about the RTL Sakai Portal, I will address these below. We are modifying a pre-existing portal in case this is useful to a […]

  2. abood says:

    Hi there,

    first of all, thanks for the posted topics it was very useful for me,

    the second thing is I apply this methodology on different version of sakai lets say 2.1 and above, because latest versions have different structure. please advice!!!

    also I would like to know why you are interested in Sakai, and why Arabic

    sorry for being curious.

    Abood

    • gonzalosilverio says:

      Hi Abood,

      I work for the University of Michigan on CTools (as Sakai is known here), so that explains my interest in Sakai. I chose Arabic as a target RTL language for the skin because it is the only language that has an almost complete translation and because I spell it, having studied it a bit in college.

      Sakai 2.1 is quite different, sure. If I remember correctly it still involved a large number of iframes, etc. The principles still apply, however. If you would like to work together on RTL’ng a Sakai 2.1 I would welcome the chance to work with you.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: