Skip to content
Snippets Groups Projects
Commit 6bd1e87a authored by Dries Buytaert's avatar Dries Buytaert
Browse files

- Patch #624290 by peximo: improved assumptions about default comment language.

parent deacaa65
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment