function locale_config_batch_update_components

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

Builds a locale batch to refresh configuration.

Parameters

array $options: An array with options that can have the following elements:

  • 'finish_feedback': (optional) Whether or not to give feedback to the user when the batch is finished. Defaults to TRUE.

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

array $components: (optional) Array of component lists indexed by type. If not present or it is an empty array, it will update all components.

bool $update_default_config_langcodes: Determines whether default configuration langcodes should be updated. This Should only happen during site and extension install.

Return value

array The batch definition.

5 calls to locale_config_batch_update_components()
ImportForm::submitForm in core/modules/locale/src/Form/ImportForm.php
install_finish_translations in core/includes/install.core.inc
Finishes importing files at end of installation.
locale_form_language_admin_add_form_alter_submit in core/modules/locale/locale.module
Form submission handler for language_admin_add_form().
locale_system_update in core/modules/locale/locale.module
Imports translations when new modules or themes are installed.
TranslationStatusForm::submitForm in core/modules/locale/src/Form/TranslationStatusForm.php

File

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

Code

function locale_config_batch_update_components(array $options, array $langcodes = [], array $components = [], bool $update_default_config_langcodes = FALSE) {
    $langcodes = $langcodes ? $langcodes : array_keys(\Drupal::languageManager()->getLanguages());
    if ($langcodes && ($names = \Drupal::service('locale.config_manager')->getComponentNames($components))) {
        // If the component list is empty we need to ensure that all configuration
        // in the default collection is using the site's default langcode.
        return locale_config_batch_build($names, $langcodes, $options, $update_default_config_langcodes);
    }
}

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