diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-11-18 19:25:28 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-11-18 19:25:28 +0000 |
commit | 6bd1e87a1c318662189b24833f32793962bd0acd (patch) | |
tree | dc343adc8c4da7d69a1a0075c3d00f8f43a17483 | |
parent | deacaa6533bbfcc8666a8b4793fe133461d85d51 (diff) | |
download | brdo-6bd1e87a1c318662189b24833f32793962bd0acd.tar.gz brdo-6bd1e87a1c318662189b24833f32793962bd0acd.tar.bz2 |
- Patch #624290 by peximo: improved assumptions about default comment language.
-rw-r--r-- | modules/locale/locale.module | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module index 709c1528c..4c364df5c 100644 --- a/modules/locale/locale.module +++ b/modules/locale/locale.module @@ -1105,3 +1105,15 @@ function locale_url_outbound_alter(&$path, &$options, $original_path) { } } } + +/* + * Implement hook_form_FORM_ID_alter(). + */ +function locale_form_comment_form_alter(&$form, &$form_state, $form_id) { + // If a content type has multilingual support we set the content language as + // comment language. + if (empty($form['language']['#value']) && locale_multilingual_node_type($form['#node']->type)) { + global $language; + $form['language']['#value'] = $language->language; + } +} |