#16944 closed Bug (worksforme)
Setting language in inline editor doesn't change language direction in content area.
Reported by: | Jakub Ś | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 4.0 |
Keywords: | Cc: |
Description
Steps to reproduce
- Open attached sample
- Change language to Arabic
Expected result
Toolbar and contentarea change direction to RTL.
Actual result
Only Toolbar changes direction to RTL. Content area stays in LTR mode.
Other details (browser, OS, CKEditor version, installed plugins)
Problem can be worked around by uncommenting this code:
var container = document.getElementById( 'editor1' ); if( languageCode == 'ug' || languageCode == 'fa' || languageCode == 'ar' || languageCode == 'he' ) container.setAttribute( 'dir', 'rtl'); else container.setAttribute( 'dir', 'ltr');
Attachments (1)
Change History (4)
Changed 8 years ago by
Attachment: | uilanguages2.html added |
---|
comment:1 Changed 8 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 8 years ago by
Resolution: | → worksforme |
---|---|
Status: | confirmed → closed |
comment:3 Changed 8 years ago by
False Alarm - http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-contentsLangDirection.
All you need is:
editor = CKEDITOR.inline( 'editor1', { language: languageCode, contentsLangDirection : ( languageCode == 'ug' || languageCode == 'fa' || languageCode == 'ar' || languageCode == 'he' ) ? 'rtl' : 'ltr', on: { instanceReady: function() { // Wait for the editor to be ready to set // the language combo. var languages = document.getElementById( 'languages' ); languages.value = this.langCode; languages.disabled = false; } } });
AFAICS Attached code is the same as in http://nightly.ckeditor.com/latest/full/ckeditor/samples/old/uilanguages.html
And it works correctly then. As you're changing the language to Arabic content's language gets also changed.
Also note that content language can be set explicitly http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-contentsLanguage