function locale_translation_batch_fetch_import
Same name and namespace in other branches
- 10 core/modules/locale/locale.batch.inc \locale_translation_batch_fetch_import()
- 11.x core/modules/locale/locale.batch.inc \locale_translation_batch_fetch_import()
- 9 core/modules/locale/locale.batch.inc \locale_translation_batch_fetch_import()
- 8.9.x core/modules/locale/locale.batch.inc \locale_translation_batch_fetch_import()
Implements callback_batch_operation().
Imports a gettext file from the translation directory. When successfully the translation status is updated.
Parameters
string $project: The name of the project to import translations.
string $langcode: Language code.
array $options: Array of import options.
array $context: The batch context.
Deprecated
in drupal:11.4.0 and is removed from drupal:13.0.0. Use \Drupal::service(LocaleFetch::class)->batchImport() instead.
See also
\Drupal\locale\LocaleImportBatch::buildBatch()
\Drupal\locale\LocaleFetch::batchDownload()
https://www.drupal.org/node/3589759
File
-
core/
modules/ locale/ locale.batch.inc, line 145
Code
function locale_translation_batch_fetch_import($project, $langcode, $options, &$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)->batchImport() instead. See https://www.drupal.org/node/3589759', E_USER_DEPRECATED);
\Drupal::moduleHandler()->loadInclude('locale', 'inc', 'locale.bulk');
\Drupal::service(LocaleFetch::class)->batchImport($project, $langcode, $options, $context);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.