Reputation: 365
I need a Arabic language plug in into CKEditor that I have mentioned below.
The optional language plugin, introduced in CKEditor 4.3, implements the WCAG 3.1.2 language of parts specification.
Here is a sample link below: http://sdk.ckeditor.com/samples/language.html
I am unable to figure out why I am unable to type Arabic in CKEditor. Although the sample clearly shows that there are three portions in different languages, is there anything necessary that I am not used or ignoring by me.
Upvotes: 1
Views: 1681
Reputation: 2445
The Language plugin inserts the lang
attribute. To find out what the Language plugin may be used for, please see this link: https://www.w3.org/International/questions/qa-lang-why
I am unable to figure out why I am unable to type Arabic in CKEditor.
This can't be controlled with JavaScript. If you want to type in Arabic or English, you need to change keyboard settings and/or layout in your operating system. Please see: https://www.windowscentral.com/how-change-your-keyboard-layout-windows-10 and https://superuser.com/questions/976947/keyboard-language-keeps-changing-in-windows-10
Upvotes: 0
Reputation: 3647
You don't need any plugin, you just need to set the text direction in the configuration of the CKEditor:
CKEDITOR.replace('your_id', {
contentsLangDirection: "rtl"
});
See working example: https://jsfiddle.net/7gb1m4g8/
NOTE: as per the contentsLangDirection documentation, you do not need to force this setting if the current UI language is already Arabic (it should be the case on computers with current language set to Arabic provided that the language is available in your instance of CKEditor):
'' (an empty string) – Indicates that content direction will be the same as either the editor UI direction or the page element direction depending on the editor type
EDIT: the Language plugin is only useful if you want to be able to have several paragraphs with different text directions.
If you really want to use this plugin, make sure you use the "Add to my editor" button from the plugin page, so that you can download a version of the CKEditor with all the required dependencies (the Language plugin is dependent on the MenuButton plugin). Else, you may also download the full preset of the ckeditor, which already includes all the plugins you need.
Upvotes: 1