function LocaleConfigBatch::batchUpdateDefaultConfigLangcodes

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

Implements callback_batch_operation().

Updates default configuration when new modules or themes are installed.

Parameters

array|\ArrayAccess $context: The batch context.

File

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

Class

LocaleConfigBatch
Provides the locale config update batch services.

Namespace

Drupal\locale

Code

public function batchUpdateDefaultConfigLangcodes(array|\ArrayAccess &$context) : void {
  $this->localeConfigManager
    ->updateDefaultConfigLangcodes();
  $context['finished'] = 1;
  $context['message'] = $this->t('Updated default configuration to %langcode', [
    '%langcode' => $this->languageManager
      ->getDefaultLanguage()
      ->getId(),
  ]);
}

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