function LocaleConfigBatch::batchUpdateConfigTranslations

Same name and namespace in other branches
  1. 11.x core/modules/locale/src/LocaleConfigBatch.php \Drupal\locale\LocaleConfigBatch::batchUpdateConfigTranslations()

Implements callback_batch_operation().

Performs configuration translation refresh.

Parameters

array $names: An array of names of configuration objects to update.

array $langcodes: (optional) Array of language codes to update. Defaults to all languages.

array|\ArrayAccess $context: Contains a list of files imported.

See also

\Drupal\locale\LocaleConfigBatch::buildBatch()

File

core/modules/locale/src/LocaleConfigBatch.php, line 111

Class

LocaleConfigBatch
Provides the locale config update batch services.

Namespace

Drupal\locale

Code

public function batchUpdateConfigTranslations(array $names, array $langcodes, array|\ArrayAccess &$context) : void {
  if (!isset($context['results']['stats']['config'])) {
    $context['results']['stats']['config'] = 0;
  }
  $context['results']['stats']['config'] += $this->localeConfigManager
    ->updateConfigTranslations($names, $langcodes);
  foreach ($names as $name) {
    $context['results']['names'][] = $name;
  }
  $context['results']['langcodes'] = $langcodes;
  $context['finished'] = 1;
}

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