1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Editing Arabic Content in Sitefinity

Editing Arabic Content in Sitefinity

3 posts, 0 answered
  1. Jay
    Jay avatar
    51 posts
    Registered:
    16 Jul 2008
    21 Oct 2011
    Link to this post
    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.
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    26 Oct 2011
    Link to this post
    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:
    body
    {
            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
  3. Jay
    Jay avatar
    51 posts
    Registered:
    16 Jul 2008
    26 Oct 2011
    Link to this post
    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:
    http://demos.telerik.com/aspnet-ajax/editor/examples/righttoleft/defaultcs.aspx

    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(!String.IsNullOrEmpty(this.Request.QueryString["language"]))
        {
            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";
            }
        }
    }



3 posts, 0 answered