function LocaleFetch::getFetchOperations
Same name and namespace in other branches
- 11.x core/modules/locale/src/LocaleFetch.php \Drupal\locale\LocaleFetch::getFetchOperations()
Helper function to construct the batch operations to fetch translations.
Parameters
array $projects: Array of project names for which to check the state of translation files. Defaults to all translatable projects.
array $langcodes: Array of language codes. Defaults to all translatable languages.
array $options: Array of import options.
Return value
array Array of batch operations.
File
-
core/
modules/ locale/ src/ LocaleFetch.php, line 111
Class
- LocaleFetch
- Provides the locale fetch services.
Namespace
Drupal\localeCode
protected function getFetchOperations(array $projects, array $langcodes, array $options) : array {
$operations = [];
foreach ($projects as $project) {
foreach ($langcodes as $langcode) {
if (locale_translation_use_remote_source()) {
$operations[] = [
self::class . ':batchDownload',
[
$project,
$langcode,
],
];
}
$operations[] = [
self::class . ':batchImport',
[
$project,
$langcode,
$options,
],
];
}
}
return $operations;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.