function locale_translate_add_language_set_batch

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.
1 call to locale_translate_add_language_set_batch()
locale_form_language_admin_add_form_alter_submit in drupal/core/modules/locale/locale.module
Form submission handler for language_admin_add_form().

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,
  );

  // See if we have language files to import for the newly added language,
  // collect and import them.
  if ($batch = locale_translate_batch_import_files($options)) {
    batch_set($batch);
  }
}