Best practices for dealing with right-to-left (RTL) languages such as Arabic and Hebrew.
What special requirements are there for RTL languages?
- Professional authoring and translation is needed unless you have native speakers on staff.
- Use Unicode support for special characters. Unicode provides complete bidirectionality support.
- The directionality of characters changes. "First ثان third." becomes ".third ثان First"
- The directionality of documents changes. This determines the order in which elements appear in the document and on the page. For example, an RTL spreadsheet will have the A column on the right side, with the B column to its left and so forth. On a Web page, horizontal navigation menu starts from the right, left column becomes the right column and so on.
Should you do just a landing page or translate the whole site?
You can start by creating a country-specific landing page rather than translating/localizing the complete site. For example, to serve visitors from the UAE create a page such as
/landing/ae, buy the
.ae country domain, and map it to the page in site definition or use virtual URI mapping. Translate only the landing page.
- Magnolia's own corporate website has an Arabic landing page
- Ginsana is a client site that has an Arabic landing page, implemented by Tinext.
- Set the
langattributes in the
- Overwrite all horizontal CSS positioning attributes in a separate stylesheet file named
rtl.css. (source: WordPress)
- Float drop cap to the right using CSS when
- Middle East Broadcasting Center (MBC) is a site completely done in Arabic.
Beware that you have to use the OLD locale code in your site's definition because else Magnolia can't resolve the locales. E.g. defining a "he" node in the site's definition, returns "iw" as language code and therefore won't fetch a messages file called messages_he.properties. So always check e.g. this list http://docs.oracle.com/javase/1.4.2/docs/guide/intl/locale.doc.html to be sure you use the right java locale.
- hebrew -> iw instead of he
To have the FCKEditor react on the Locale set in Magnolia, and not the browser language only, you can add the following script to your init file.
After a dialog with the FCKEditor is loaded this scripts checks the URL of for the mgnlLocale property and gets the language out of it.
To mirror the edit fields of the dialogs, you can use the following code samples:
This class creates depending on the locale a normal Edit object or an RTLEdit object. The code for the RTLEdit class is as follows:
Set the new control class under /modules/adminInterface/controls/edit/class = my.package.BidirectionalDialogEdit and you are good to go!