On a Drupal 7.1 installation with several languages ("/admin/config/regional/language"), the editor provided by the CKEditor 7.x-1.1 module does not follow the user language (which can be setup by the user via "/user").

The editor still uses english only for the icons captions.

CKEditor in configured via "/admin/config/content/ckeditor/edit/Full", and the setup done is :
- Language : English
- Auto-detect language : Enabled


dczepierga’s picture

Status: Active » Postponed (maintainer needs more info)

CKEditor library not using user defined language in Drupal, but auto-detect user browser language and use it - so if u try to check this in browser with english language u will get this language in the editor, if u have browser with german language u also will have CKEditor translated to german language...

We never get feature request issue to do something like this, but i don't know does it needed here in this case?
Maybe other people say what they think about feature like this...


Levure’s picture

In my opinion (but this is only my opinion), it would make sense to use the user defined language in Drupal since Drupal offers that feature (and it would several different language detection in a same CMS).

Thus, many people are ignoring the fact they can setup their prefered language page in browser settings.

I don't say you have to (because this is your module, not mine), drop auto-detect user browser language and use only user defined language in Drupal.

I think the solution would be to add a select box (or radio) to allow choosing the prefered user language detection :
- Browser language
- User language Drupal setting

Default setting should then be "Browser language" to avoid breaking existing setup.

As said by dczepierga : other people opinions are welcome !


Levure’s picture

Can you tell if the implementation of that feature would take a lot of time ?

If you can give some tips (for example, where it is possible to change CKEditor configuration settings before the editor is rendered), I could implement them, or build another module.

I see something like this :
- If the language detection is set on "Browser language", no changes
- If the language detection is set on "User language Drupal setting", I would disable auto-detect and force the editor language with the Drupal user language.


caiosba’s picture

Status: Postponed (maintainer needs more info) » Needs review
2.26 KB

I can see that it also happens on Drupal 6.
The CKEditor only gives you two options to deal with localization:
Force a language, that you can choose, or auto-detect the browser
I've added one more option, to get the Drupal language.
Patch is attached.

soulfroys’s picture

@caiosba, thanks for the patch!!! It worked smoothly.

Sorry, I forgot this important information:
CKEditor 6.x-1.x-dev (2012-Jan-05)
CKEditor (library) 3.6.2

soulfroys’s picture

mkesicki’s picture

@soulfroys thank you for review.

infojunkie’s picture

Version: 7.x-1.1 » 6.x-1.9
Status: Needs review » Reviewed & tested by the community
Levure’s picture

@caiosba, thanks for the work done !

MarkU’s picture

The same problem arises with CKEditor installed via the WYSIWYG module - can anyone help me out ?

On a site with multilingual content, and hence authors contributing in a variety of languages, it is really very important that the editor interface reflects each authors preferred language.


(I'm new to Drupal by the way)

soulfroys’s picture

Please... Will this patch be committed?
Need to be fixed in D7 first...

soulfroys’s picture

Re-rolled against the latest dev (2013-Jan-11).
Credits: @caiosba in #4).

soulfroys’s picture

Status: Reviewed & tested by the community » Needs review

Well, I tried making the porting but no success... :(

heyyo’s picture

Version: 6.x-1.9 » 7.x-1.x-dev
StephenN’s picture

d7 port against 7.x-1.13, very lightly tested

heyyo’s picture

I just tested your patch StephenN works great for me. Thanks.

martichka5’s picture

Hi, everyone!
We have the same problem that ckeditor language detection is enabled but does not work. All plugin labels stay untranslated.
After research i've committed patch with two small changes.
The first one is in the ckeditor.lib.inc file. There is a check if auto-language detection is off, but the problem is that they do nothing in the other case. So, i added else statement that assigns the current site language from the global language variable.

The second change is in the media plugin.js file. We need this plugin label translated. So, our solution was to add Drupal.t function to media plugin label and to update .po file with the needed string. The last was necessary because this js file is executed dynamically and the string was not recorded to the database and then did not appear in the translation interface.

bwaindwain’s picture

Issue summary: View changes

In our multilingual site, we needed to be able to set the CKEditor UI and contents languages independently. CKEditor has a contentsLang and contentsLangDirection setting. At /admin/config/content/ckeditor, edit your profile and in the "Advanced Options > Custom JavaScript configuration" add the lines:

config.contentsLanguage = document.getElementById(textarea_id).lang;
config.contentsLangDirection = document.getElementById(textarea_id).dir; 

As long as the textarea has the correct language and direction attributes set, CKEditor will now match.

FYI: Set your form element attributes with #attributes

tobiberlin’s picture

The Patch in #15 worked for me with version 7.x-1.17.