diff --git a/core/modules/node/node.js b/core/modules/node/node.js index e54a4d4..56b1972 100644 --- a/core/modules/node/node.js +++ b/core/modules/node/node.js @@ -44,18 +44,20 @@ Drupal.behaviors.nodeFieldsetSummaries = { }); $context.find('fieldset.node-translation-options').drupalSetSummary(function (context) { - var translate; - var $checkbox = $context.find('.form-item-translation-translate input'); + var $checkbox_translate = $context.find('.form-item-translation-translate input'); + var translate_vals = []; - if ($checkbox.size()) { - translate = $checkbox.is(':checked') ? Drupal.t('Needs to be updated') : Drupal.t('Does not need to be updated'); + if ($checkbox_translate.size()) { + translate_vals.push($checkbox_translate.is(':checked') ? Drupal.t('Needs to be updated') : Drupal.t('Does not need to be updated')); } - else { - $checkbox = $context.find('.form-item-translation-retranslate input'); - translate = $checkbox.is(':checked') ? Drupal.t('Flag other translations as outdated') : Drupal.t('Do not flag other translations as outdated'); + + var $checkbox_retranslate = $context.find('.form-item-translation-retranslate input'); + + if ($checkbox_retranslate.size()) { + translate_vals.unshift($checkbox_retranslate.is(':checked') ? Drupal.t('Flag other translations as outdated') : Drupal.t('Do not flag other translations as outdated')); } - return translate; + return translate_vals.join(', '); }); } }; diff --git a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php index 5489245..d7af2e9 100644 --- a/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php +++ b/core/modules/translation_entity/lib/Drupal/translation_entity/EntityTranslationController.php @@ -211,8 +211,16 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac '#access' => $this->getTranslationAccess($entity, $form_langcode), ); - $translate = !$new_translation && $entity->retranslate[$form_langcode]; - if (!$translate) { + if (!$new_translation) { + $form['translation']['translate'] = array( + '#type' => 'checkbox', + '#title' => t('This translation needs to be updated'), + '#default_value' => $entity->retranslate[$form_langcode], + '#description' => t('When this option is checked, this translation needs to be updated. Uncheck when the translation is up to date again.'), + ); + } + + if ($new_translation || !$entity->retranslate[$form_langcode]) { $form['translation']['retranslate'] = array( '#type' => 'checkbox', '#title' => t('Flag other translations as outdated'), @@ -220,14 +228,6 @@ public function entityFormAlter(array &$form, array &$form_state, EntityInterfac '#description' => t('If you made a significant change, which means the other translations should be updated, you can flag all other translations of this content as outdated. This will not change any other property of them, like whether they are published or not.'), ); } - else { - $form['translation']['translate'] = array( - '#type' => 'checkbox', - '#title' => t('This translation needs to be updated'), - '#default_value' => $translate, - '#description' => t('When this option is checked, this translation needs to be updated. Uncheck when the translation is up to date again.'), - ); - } } // Process the submitted values before they are stored. diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module index 13e4105..0f3cff6 100644 --- a/core/modules/translation_entity/translation_entity.module +++ b/core/modules/translation_entity/translation_entity.module @@ -29,7 +29,7 @@ function translation_entity_help($path, $arg) { $output .= '
' . t('The source language can be changed. If you enable more than two languages and you create at least one content translation, when creating subsequent translations you will be able to choose which language to translate from through the Source language selector. If you choose a different language from the default one, all the translation form elements will be repopulated with the values from the specified source.') . '