phpjqueryfckeditor

FCKeditor arabic language not coming up


I am using FCKeditor in one of my projects.

<textarea name="Content_Arabic" id="Content_Arabic" cols="35" rows="4" class="txtfield"><?php echo (stripslashes(stripslashes($_POST['Content'])));?></textarea>
<script type="text/javascript">
    var editor = new ew_DHTMLEditor("Content_Arabic");

    editor.create = function() {
        var sBasePath = 'FCKeditor/';
        var oFCKeditor = new FCKeditor('Content_Arabic', '100%', 350, 'Default');
        oFCKeditor.BasePath = sBasePath;
        oFCKeditor.ReplaceTextarea();
        oFCKeditor.rtl;
         oFCKeditor.ContentLangDirection='rtl';
        this.active = true;
    }
    ew_DHTMLEditors[ew_DHTMLEditors.length] = editor;

    ew_CreateEditor();  // Create DHTML editor(s)

    //-->
</script>

This loaded editor but it's still English style.

I want it to load as Arabic language style, from right to left.


Solution

  • The solution below assumes that you want this configuration statically for all the instances of the FCKEditor in your solution*.

    Simply edit the file /path/to/your_fckeditor_installation_dir/fckeditor.js and change the following properties as follows:

    FCKConfig.AutoDetectLanguage    = false ;
    FCKConfig.DefaultLanguage       = 'ar' ;
    


    EDIT

    From your code above you just need the following lines (delete the rest):

    var oFCKeditor = new FCKeditor('Content_Arabic', '100%', 350, 'Default');
    oFCKeditor.BasePath = 'FCKeditor/';
    oFCKeditor.ReplaceTextarea();
    

    And that's all!

    *If you want this to change dynamically then you should alter your approach following these guidelines