diff --git a/ckeditor.module b/ckeditor.module index 48ed30e..def34b9 100644 --- a/ckeditor.module +++ b/ckeditor.module @@ -668,6 +668,9 @@ function ckeditor_process_textarea($element) { if ($conf['auto_lang']=="f") { $settings[$textarea_id]['language'] = $conf['lang']; } + else if ($conf['auto_lang']=="d") { + $settings[$textarea_id]['language'] = $language->language; + } if (isset($element['#scayt_language'])) { $settings[$textarea_id]['scayt_sLang'] = $element['#scayt_language']; } @@ -1347,4 +1350,4 @@ function ckeditor_get_settings() if (empty($_SESSION['cke_get_settings'][$_POST['id']])) echo json_encode(array()); echo json_encode($_SESSION['cke_get_settings'][$_POST['id']]); die(); -} \ No newline at end of file +} diff --git a/includes/ckeditor.admin.inc b/includes/ckeditor.admin.inc index a3a0cdc..6ec83ae 100644 --- a/includes/ckeditor.admin.inc +++ b/includes/ckeditor.admin.inc @@ -592,7 +592,8 @@ function ckeditor_admin_profile_form($form_state, $profile = NULL) { '#title' => t('Auto-detect language'), '#default_value' => !empty($profile->settings['auto_lang']) ? $profile->settings['auto_lang'] : 't', '#options' => array( - 't' => t('Enabled'), + 't' => t('Enabled (browser language)'), + 'd' => t('Enabled (Drupal language)'), 'f' => t('Disabled') ), '#description' => t('Automatically detect the user language.') @@ -1701,4 +1702,4 @@ function ckeditor_toolbar_buttons_all() { } return $buttons; -} \ No newline at end of file +} diff --git a/includes/ckeditor.user.inc b/includes/ckeditor.user.inc index 1da5d13..c05f192 100644 --- a/includes/ckeditor.user.inc +++ b/includes/ckeditor.user.inc @@ -138,7 +138,8 @@ function ckeditor_user_delegate($type, $edit, &$user, $category = NULL) { '#title' => t('Auto-detect language'), '#default_value' => isset($user->ckeditor_auto_lang) ? $user->ckeditor_auto_lang : (isset($profile->settings['auto_lang']) ? $profile->settings['auto_lang'] : 't'), '#options' => array( - 't' => t('Yes'), + 't' => t('Yes (browser language)'), + 'd' => t('Yes (Drupal language)'), 'f' => t('No') ), '#description' => t('Automatically detect the user language.')