summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDries Buytaert2009-11-18 19:25:28 (GMT)
committerDries Buytaert2009-11-18 19:25:28 (GMT)
commit6bd1e87a1c318662189b24833f32793962bd0acd (patch)
treedc343adc8c4da7d69a1a0075c3d00f8f43a17483
parentdeacaa6533bbfcc8666a8b4793fe133461d85d51 (diff)
- Patch #624290 by peximo: improved assumptions about default comment language.
-rw-r--r--modules/locale/locale.module12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 709c152..4c364df 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;
+ }
+}