function locale_translation_batch_fetch_download

Same name and namespace in other branches
  1. 10 core/modules/locale/locale.batch.inc \locale_translation_batch_fetch_download()
  2. 11.x core/modules/locale/locale.batch.inc \locale_translation_batch_fetch_download()
  3. 9 core/modules/locale/locale.batch.inc \locale_translation_batch_fetch_download()
  4. 8.9.x core/modules/locale/locale.batch.inc \locale_translation_batch_fetch_download()

Implements callback_batch_operation().

Downloads a remote gettext file into the translations directory. When successfully the translation status is updated.

Parameters

string $project: The name of the project to import translations.

string $langcode: Language code.

array $context: The batch context.

Deprecated

in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(LocaleFetch::class)->batchDownload() instead.

See also

\Drupal\locale\LocaleFetch::batchImport()

https://www.drupal.org/node/3589759

File

core/modules/locale/locale.batch.inc, line 116

Code

function locale_translation_batch_fetch_download($project, $langcode, &$context) : void {
  @trigger_error(__FUNCTION__ . '() is deprecated in drupal:11.4.0 and is removed from drupal:13.0.0. Use \\Drupal::service(LocaleFetch::class)->batchDownload() instead. See https://www.drupal.org/node/3589759', E_USER_DEPRECATED);
  \Drupal::service(LocaleFetch::class)->batchDownload($project, $langcode, $context);
}

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