diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index 06480c8..1cfb078 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -1038,8 +1038,10 @@ function language_content_settings_page() { /** * Form constructor for the content language settings form. * + * @param array $supported + * Entity types with language support. + * * @see language_content_settings_form_submit() - * @see language_content_settings_form_validate() * * @ingroup forms */ @@ -1072,7 +1074,7 @@ function language_content_settings_form(array $form, array $form_state, array $s ); $form['entity_types'] = array( - '#title' => t('Language support'), + '#title' => t('Custom language settings'), '#type' => 'checkboxes', '#options' => $labels, '#default_value' => $default, @@ -1121,9 +1123,10 @@ function language_content_settings_form(array $form, array $form_state, array $s } /** - * Adds a render element representing the bundle language settings table. + * Implements hook_preprocess_HOOK() for theme_language_content_settings_table(). */ function template_preprocess_language_content_settings_table(&$variables) { + // Add a render element representing the bundle language settings table. $element = $variables['element']; $header = array( @@ -1166,7 +1169,7 @@ function template_preprocess_language_content_settings_table(&$variables) { } /** - * Theming function for an administration settings table. + * Returns HTML for an administration settings table. * * @param array $variables * An associative array containing: diff --git a/core/modules/language/language.module b/core/modules/language/language.module index c293031..9ecd1c5 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -54,7 +54,7 @@ function language_help($path, $arg) { break; case 'admin/config/regional/content-language': - return t('Enable language support for content types, taxonomy vocabularies, user profiles, or any other supported element on your site.'); + return t('Change language settings for content types, taxonomy vocabularies, user profiles, or any other supported element on your site. By default, language settings hide the language selector and the language is the site\'s default language.'); } } diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSettingsTest.php b/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSettingsTest.php index fe596de..1f01e4b 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSettingsTest.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/Tests/EntityTranslationSettingsTest.php @@ -2,7 +2,7 @@ /** * @file - * Contains Drupal\entity\Tests\EntityTranslationSettingsTest. + * Contains Drupal\translation_entity\Tests\EntityTranslationSettingsTest. */ namespace Drupal\translation_entity\Tests; @@ -107,6 +107,7 @@ function testSettingsUI() { * TRUE if translatibility should be enabled, FALSE otherwise. * @param array $edit * An array of values to submit to the entity translation settings page. + * * @return boolean * TRUE if the assertion succeeded, FALSE otherwise. */ diff --git a/core/modules/translation_entity/translation_entity.admin.inc b/core/modules/translation_entity/translation_entity.admin.inc index 26924d0..b5fb9d0 100644 --- a/core/modules/translation_entity/translation_entity.admin.inc +++ b/core/modules/translation_entity/translation_entity.admin.inc @@ -8,12 +8,13 @@ use Drupal\Core\Entity\EntityInterface; /** - * Injects into the content language settings the translation settings. + * Implements hook_form_FORM_ID_alter() for language_content_settings_form(). * - * @see language_content_settings_form() * @see translation_entity_form_language_content_settings_form_alter() */ function _translation_entity_form_language_content_settings_form_alter(array &$form, array &$form_state) { + // Inject into the content language settings the translation settings. + $default = $form['entity_types']['#default_value']; foreach ($default as $entity_type => $enabled) { $default[$entity_type] = $enabled || translation_entity_enabled($entity_type) ? $entity_type : FALSE; @@ -116,7 +117,7 @@ function translation_entity_form_language_content_settings_submit(array $form, a * @param array $settings * An associative array of settings keyed by entity type and bundle. At bundle * level the following keys are available: - * - translatable: The bundle translatability status. + * - translatable: The bundle translatability status, which is a bool. * - settings: An array of language configuration settings as defined by * language_save_default_configuration(). * - fields: An associative array with field names as keys and a boolean as diff --git a/core/modules/translation_entity/translation_entity.info b/core/modules/translation_entity/translation_entity.info index f84747b..8a7ef0c 100644 --- a/core/modules/translation_entity/translation_entity.info +++ b/core/modules/translation_entity/translation_entity.info @@ -4,4 +4,4 @@ dependencies[] = language package = Multilingual version = VERSION core = 8.x -configure = admin/config/regional/translation_entity +configure = admin/config/regional/content-language diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module index f7a35bf..d955d02 100644 --- a/core/modules/translation_entity/translation_entity.module +++ b/core/modules/translation_entity/translation_entity.module @@ -23,7 +23,7 @@ function translation_entity_help($path, $arg) { $output .= '
'; $output .= '
' . t('Enabling translation') . '
'; $output .= '

' . t('Before you can translate content, there must be at least two non-system languages added on the languages administration page.', array('!url' => url('admin/config/regional/language'))) . '

'; - $output .= '

' . t('After adding languages, configure translation.', array('!url' => url('admin/config/regional/translation_entity'))) . '

'; + $output .= '

' . t('After adding languages, configure translation.', array('!url' => url('admin/config/regional/content-language'))) . '

'; $output .= '
' . t('Translating content') . '
'; $output .= '
' . t('After enabling translation you can create a new piece of content, or edit existing content and assign it a language. Then, you will see a Translations tab or link that will gives an overview of the translation status for the current content. From there, you can add translations and edit or delete existing translations. This process is similar for every translatable element on your site, such as taxonomy terms, comments or user accounts.') . '
'; $output .= '
' . t('Changing source language') . '
'; @@ -160,7 +160,7 @@ function translation_entity_menu() { } } - $items['admin/config/regional/translation_entity/translatable/%'] = array( + $items['admin/config/regional/content-language/translatable/%'] = array( 'title' => 'Confirm change in translatability.', 'description' => 'Confirm page for changing field translatability.', 'page callback' => 'drupal_get_form', @@ -583,7 +583,7 @@ function translation_entity_form_field_ui_field_settings_form_alter(array &$form $title = t('Users may translate this field.'); if (field_has_data($field)) { - $path = "admin/config/regional/translation_entity/translatable/$field_name"; + $path = "admin/config/regional/content-language/translatable/$field_name"; $status = $translatable ? $title : t('This field has data in existing content.'); $link_title = !$translatable ? t('Enable translation') : t('Disable translation'); @@ -715,7 +715,7 @@ function translation_entity_language_configuration_element_submit(array $form, a } /** - * Implements hook_form_FORM_ID_alter(). + * Implements hook_form_FORM_ID_alter() for language_content_settings_form(). */ function translation_entity_form_language_content_settings_form_alter(array &$form, array &$form_state) { module_load_include('inc', 'translation_entity', 'translation_entity.admin'); @@ -728,7 +728,7 @@ function translation_entity_form_language_content_settings_form_alter(array &$fo * @param array $settings * An associative array of settings keyed by entity type and bundle. At bundle * level the following keys are available: - * - translatable: The bundle translatability status. + * - translatable: The bundle translatability status, which is a bool. * - settings: An array of language configuration settings as defined by * language_save_default_configuration(). * - fields: An associative array with field names as keys and a boolean as @@ -746,9 +746,11 @@ function translation_entity_save_settings($settings) { } /** - * Alters the 'build' variable injecting the translation settings. + * Implements hook_preprocess_HOOK() for theme_language_content_settings_table(). */ function translation_entity_preprocess_language_content_settings_table(&$variables) { + // Alter the 'build' variable injecting the translation settings. + $element = $variables['element']; $build = &$variables['build'];