function LocaleProjectChecker::checkProjects
Same name and namespace in other branches
- 11.x core/modules/locale/src/LocaleProjectChecker.php \Drupal\locale\LocaleProjectChecker::checkProjects()
Check for the latest release of project translations.
Parameters
array $projects: Array of project names to check.
array $langcodes: Array of language codes. Defaults to all translatable languages.
File
-
core/
modules/ locale/ src/ LocaleProjectChecker.php, line 47
Class
- LocaleProjectChecker
- Provide Locale Project Checker helper methods.
Namespace
Drupal\localeCode
public function checkProjects(array $projects, array $langcodes = []) : void {
if ($this->configFactory
->get('locale.settings')
->get('translation.use_source') == LOCALE_TRANSLATION_USE_SOURCE_REMOTE_AND_LOCAL) {
// Retrieve the status of both remote and local translation sources by
// using a batch process.
$this->triggerBatch($projects, $langcodes);
}
else {
// Retrieve and save the status of local translations only.
$this->checkLocalProjects($projects, $langcodes);
$this->localeSource
->updateLastChecked();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.