Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Arabic content ? Any experience ?

Go to End

9 Posts   2819 Views


Community Member, 78 Posts

16 November 2010 at 5:19am

Edited: 01/12/2010 10:49pm

Hi folks,

we have a customer request, building a website with english and arabic (multilingual) content.
Are there any existing expreriences ?

KInd regards,


Edit: solved
i had to put

 i18n::$common_locales['ar_SA'] = array('Arabic');

in my _config.php


Community Member, 88 Posts

18 November 2010 at 4:58am

Yes, we have build a site that was meant to be used in arabic language (and sooner or later will be). Although it is possible, there are some inconsistencies in the backend.
1) you will have to write manual checks for switching reading direction. this will be dependend on the logged in user settings. this works good in many situations (tinymce), but somehow it doesn't work an all fields.
2) its not possible to switch directionality for every item in the admin UI. Serveral field descriptions are displayed at the top left corner of a text input field, although writing inside this textbox works RTL. you will have to make some tradeoffs according work amount <-> complete arabic UI

At frontend level everything (except metadata) can be achieved by css files, that can be comfortably loaded according to active language. Metadata stuff is a matter of template design, this works well if you know how to use translatable and i18n extensions.


Community Member, 78 Posts

18 November 2010 at 5:04am

Hi Dompie,

thanks a lot for your opinion/experience.
But the backend/cms is planned to stay in english.
I have no idea, if an "arabic content editor" needs a RTL backend/cms ....



Community Member, 88 Posts

18 November 2010 at 5:15am

In most cases it's sufficient you have textareas in RTL mode (that's what we did in the end).


Community Member, 78 Posts

1 December 2010 at 10:19pm

Edited: 01/12/2010 10:20pm


i set up a dev environment and i do not get arabic (ar_SA) inside the translation tab ?????

Translatable::set_allowed_locales( array('de_DE', 'en_US', 'ar_SA' ) );

If i use 'he_IL' (hebrew) or 'fr_FR' (french) everythings works as expected. But NOT 'ar_SA' (arabic - saudi arabia).
The arabic lang is missing in the "language" pulldown on the left area of cms AND it is missing inside the translation tab of a page...

Any ideas ?

Kind regards, Robert


Community Member, 88 Posts

2 December 2010 at 12:51am

Did you also set i18n? Don't know if this may have any effect, but I always used them together and SiteTree also (somehow) uses i18n.

// Set the site locale and allowed languages
$allowed_locales = array(
	'de_DE' => array('German', 'Deutsch'),
	'en_US' => array('English', 'English'),
	'ar_EG' => array('Arabic', 'العربية')
i18n::$common_locales = $allowed_locales;

// Make Pages translateable into other languages
Translatable::set_allowed_locales(array('en_US', 'de_DE', 'ar_EG'));


Community Member, 78 Posts

2 December 2010 at 12:54am

Ahh, sorry,

in the meantime i figured it out but i edited my first post instead of the latest one.
But thx.

For testing reasons, is there a quick solution to switch the form fields and tinyMCE (inside cms) to RTL mode ?

Thanks in advance,


Community Member, 88 Posts

2 December 2010 at 1:05am

Yes, it took me a while to figure this one out. Probably not the best solution, but it works. I've put it in the _config.php to make sure it's already set when SilverStripe outputs Backend stuff.

// Switch directionality for arabic sites in Backend Editors
if(stristr($_SERVER['REQUEST_URI'], 'ar_EG') !== FALSE || stristr($_SERVER['REQUEST_URI'], 'ar-')){
	HtmlEditorConfig::get('cms')->setOption('directionality', 'rtl');

Go to Top