function locale_config_batch_finished

Same name in other branches
  1. 9 core/modules/locale/locale.bulk.inc \locale_config_batch_finished()
  2. 10 core/modules/locale/locale.bulk.inc \locale_config_batch_finished()
  3. 11.x core/modules/locale/locale.bulk.inc \locale_config_batch_finished()

Implements callback_batch_finished().

Finishes callback of system page locale import batch.

Parameters

bool $success: Information about the success of the batch import.

array $results: Information about the results of the batch import.

See also

locale_config_batch_build()

1 call to locale_config_batch_finished()
locale_translate_batch_finished in core/modules/locale/locale.bulk.inc
Implements callback_batch_finished().
1 string reference to 'locale_config_batch_finished'
locale_config_batch_build in core/modules/locale/locale.bulk.inc
Creates a locale batch to refresh specific configuration.

File

core/modules/locale/locale.bulk.inc, line 641

Code

function locale_config_batch_finished($success, array $results) {
    if ($success) {
        $configuration = isset($results['stats']['config']) ? $results['stats']['config'] : 0;
        if ($configuration) {
            \Drupal::messenger()->addStatus(t('The configuration was successfully updated. There are %number configuration objects updated.', [
                '%number' => $configuration,
            ]));
            \Drupal::logger('locale')->notice('The configuration was successfully updated. %number configuration objects updated.', [
                '%number' => $configuration,
            ]);
        }
        else {
            \Drupal::messenger()->addStatus(t('No configuration objects have been updated.'));
            \Drupal::logger('locale')->warning('No configuration objects have been updated.');
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.