Editing Arabic Content in Sitefinity

Posted by Community Admin on 04-Aug-2018 17:10

Editing Arabic Content in Sitefinity

All Replies

Posted by Community Admin on 21-Oct-2011 00:00

I'm building a website which is in both English and Arabic.  Sitefinity says that it supports Arabaic.... but it doesn't really work the way it should.  When editing content on an Arabic page, content blocks and editor controls should show text in RTL format.  This should be a default when working with pages in Arabic (or Hebrew or Farsi) but for some reason it isn't.

I'm trying to find a way to enable this by using ViewMaps to check my pages's theme and if it's Arabic, switch the controls into RTL mode.  I have a support ticket with the Telerik team for this but so far they've proven not helpful at all.  Has anyone here been able to actually get this to work?

Any help would be appreciated.

Posted by Community Admin on 26-Oct-2011 00:00

Hi Jay,

Thank you for using our services. Since Sitefinity 4.2 we have introduced multilingual templates functionality. This will allow you to create separate templates for your English and Arabic pages, and on the Arabic ones you can apply different theme/ CSS style that loads RTL text direction. For example:

        font-family: Georgia;
        color: black;
        font-size: 12px;
        background: white;
        direction: rtl;

I hope you find this information useful. If you need some additional information or have any further questions, please let us know.

Kind regards,
Boyan Barnev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 26-Oct-2011 00:00

I was actually referring to the editor controls INSIDE Sitefinity, not my templates.

In any case, Radoslav Georgiev from the Telerik team was able to provide a solution.  (NOTE to Telerk: Give that man a raise!)

For anyone else that needs RTL editing inside Sitefinity, you can override the HtmlField template to do so:
See http://www.sitefinity.com/blogs/joshmorales/posts/11-07-26/customizing_sitefinity_4_controls_with_the_viewmap.aspx for how to set that up.

You can pull the RTL stylesheets you need for RadEditor here:

In your HtmlField template you'll need to add the following Page_Load event to check for the presence of Arabic (or Hebrew or Farsi) and load the proper editor stylesheets:

protected void Page_Load(object sender, EventArgs e)
    System.Globalization.CultureInfo cultureInfo = System.Threading.Thread.CurrentThread.CurrentUICulture;
    // this will work both for pages and for content modules and will set the RadEditor to be Right to left
        if(this.Request.QueryString["language"] == "ar")
            editControl.DialogsCssFile = "~/Sitefinity/WebsiteTemplates/MySite/App_Themes/Arabic/Editor/RadEditor_Dialogs_RTL.css";
            editControl.ContentAreaCssFile = "~/Sitefinity/WebsiteTemplates/MySite/App_Themes/Arabic/Editor/EditorContentArea_RTL.css";
    //if you only need this for pages you can use the second if statement   
    else if(!String.IsNullOrEmpty(this.Request.QueryString["propertyValueCulture"]))
        if(this.Request.QueryString["propertyValueCulture"] == "ar")
            editControl.DialogsCssFile = "~/Sitefinity/WebsiteTemplates/MySite/App_Themes/Arabic/Editor/RadEditor_Dialogs_RTL.css";
            editControl.ContentAreaCssFile = "~/Sitefinity/WebsiteTemplates/MySite/App_Themes/Arabic/Editor/EditorContentArea_RTL.css";

This thread is closed