diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index 75661ce..0edc193 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -361,8 +361,10 @@ function language_negotiation_configure_form() { '#language_negotiation_info' => language_negotiation_info(), ); $form['#language_types'] = array(); - foreach ($form['#language_types_info'] as $type => $value) { - if (!empty($value['name'])) { + foreach ($form['#language_types_info'] as $type => $info) { + // Show locked language types only if they do not already define a fixed + // configuration. In the latter case they always are configurable. + if (empty($info['locked']) || !isset($info['fixed'])) { $form['#language_types'][] = $type; } } diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 8e75500..9ae1109 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -620,14 +620,17 @@ function language_language_types_info() { LANGUAGE_TYPE_INTERFACE => array( 'name' => t('User interface text'), 'description' => t('Order of language detection methods for user interface text. If a translation of user interface text is available in the detected language, it will be displayed.'), + 'locked' => TRUE, ), LANGUAGE_TYPE_CONTENT => array( 'name' => t('Content'), 'description' => t('Order of language detection methods for content. If a version of content is available in the detected language, it will be displayed.'), 'fixed' => array(LANGUAGE_NEGOTIATION_INTERFACE), + 'locked' => TRUE, ), LANGUAGE_TYPE_URL => array( 'fixed' => array(LANGUAGE_NEGOTIATION_URL, LANGUAGE_NEGOTIATION_URL_FALLBACK), + 'locked' => TRUE, ), ); } diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module index 83973f4..f38ea74 100644 --- a/core/modules/translation_entity/translation_entity.module +++ b/core/modules/translation_entity/translation_entity.module @@ -60,6 +60,14 @@ function translation_entity_module_implements_alter(&$implementations, $hook) { } /** + * Implements hook_language_type_info_alter(). + */ +function translation_entity_language_types_info_alter(array &$language_types) { + // Make content language negotiation customizable by unlocking it. + unset($language_types[LANGUAGE_TYPE_CONTENT]['locked']); +} + +/** * Implements hook_entity_info_alter(). */ function translation_entity_entity_info_alter(array &$entity_info) {