diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index 13636aa00b..647e36acad 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1726,12 +1726,11 @@ function install_download_additional_translations_operations(&$install_state) { */ function install_import_translations(&$install_state) { \Drupal::moduleHandler()->loadInclude('locale', 'translation.inc'); - \Drupal::moduleHandler()->loadInclude('locale', 'batch.inc'); // If there is more than one language or the single one is not English, we // should import translations. $operations = array_merge( - ['locale_batch_store_finish_feedback', [FALSE]], + ['locale_translation_batch_store_finish_feedback', [FALSE]], install_download_additional_translations_operations($install_state) ); $languages = \Drupal::languageManager()->getLanguages(); diff --git a/core/modules/locale/locale.batch.inc b/core/modules/locale/locale.batch.inc index c1b2fd98a1..97fe3c8779 100644 --- a/core/modules/locale/locale.batch.inc +++ b/core/modules/locale/locale.batch.inc @@ -85,6 +85,23 @@ function locale_translation_batch_status_check($project, $langcode, array $optio $context['message'] = t('Checked translation for %project.', ['%project' => $source->project]); } +/** + * Implements callback_batch_operation(). + * + * Stores the finish_feedback value in batch results for use in the finish + * callback. + * + * @param bool $finish_feedback + * Whether user feedback should be provided at the end of the batch. + * @param array|\ArrayAccess $context + * The batch context. + * + * @see locale_config_batch_build() + */ +function locale_translation_batch_store_finish_feedback($finish_feedback, &$context) { + $context['results']['finish_feedback'] = $finish_feedback; +} + /** * Implements callback_batch_finished(). * diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index c11ca31781..94782cf60a 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -139,7 +139,7 @@ function locale_translate_batch_build(array $files, array $options) { ]; if (count($files)) { $operations = [ - ['locale_batch_store_finish_feedback', [$options['finish_feedback']]], + ['locale_translate_batch_store_finish_feedback', [$options['finish_feedback']]], ]; foreach ($files as $file) { // We call locale_translate_batch_import for every batch operation. @@ -564,7 +564,7 @@ function locale_config_batch_build(array $names, array $langcodes, array $option $i = 0; $batch_names = []; $operations = [ - ['locale_batch_store_finish_feedback', [$options['finish_feedback']]], + ['locale_translate_batch_store_finish_feedback', [$options['finish_feedback']]], ]; foreach ($names as $name) { $batch_names[] = $name; @@ -605,7 +605,7 @@ function locale_config_batch_build(array $names, array $langcodes, array $option * * @see locale_config_batch_build() */ -function locale_batch_store_finish_feedback($finish_feedback, &$context) { +function locale_translate_batch_store_finish_feedback($finish_feedback, &$context) { $context['results']['finish_feedback'] = $finish_feedback; }