Sets a batch for a newly-added language.
Parameters
array $options:
An array with options that can have the following elements:
- 'langcode': The language code, required.
- 'overwrite_options': Overwrite options array as defined in
Drupal\locale\PoDatabaseWriter. Optional, defaults to an empty array.
- 'customized': Flag indicating whether the strings imported from $file
are customized translations or come from a community source. Use
LOCALE_CUSTOMIZED or LOCALE_NOT_CUSTOMIZED. Optional, defaults to
LOCALE_NOT_CUSTOMIZED.
- 'finish_feedback': Whether or not to give feedback to the user when the
batch is finished. Optional, defaults to TRUE.
File
- drupal/core/modules/locale/locale.bulk.inc, line 282
- Mass import-export and batch import functionality for Gettext .po files.
Code
function locale_translate_add_language_set_batch($options) {
$options += array(
'overwrite_options' => array(),
'customized' => LOCALE_NOT_CUSTOMIZED,
'finish_feedback' => TRUE,
);
if ($batch = locale_translate_batch_import_files($options)) {
batch_set($batch);
}
}