Creates a locale batch to refresh specific configuration.
array $names: List of configuration object names (which are strings) to update.
array $langcodes: List of language codes to refresh.
array $options: (optional) An array with options that can have the following elements:
array The batch definition.
locale_config_batch_refresh_name()
function locale_config_batch_build(array $names, array $langcodes, $options = array()) {
$options += array(
'finish_feedback' => TRUE,
);
$t = get_t();
foreach ($names as $name) {
$operations[] = array(
'locale_config_batch_refresh_name',
array(
$name,
$langcodes,
),
);
}
$batch = array(
'operations' => $operations,
'title' => $t('Updating configuration translations'),
'init_message' => $t('Starting configuration update'),
'error_message' => $t('Error updating configuration translations'),
'file' => drupal_get_path('module', 'locale') . '/locale.bulk.inc',
);
if (!empty($options['finish_feedback'])) {
$batch['completed'] = 'locale_config_batch_finished';
}
return $batch;
}