function locale_translation_check_projects

Same name and namespace in other branches
  1. 9 core/modules/locale/locale.compare.inc \locale_translation_check_projects()
  2. 10 core/modules/locale/locale.compare.inc \locale_translation_check_projects()
  3. 11.x core/modules/locale/locale.compare.inc \locale_translation_check_projects()

Check for the latest release of project translations.

@todo Return batch or NULL.

Parameters

array $projects: Array of project names to check. Defaults to all translatable projects.

string $langcodes: Array of language codes. Defaults to all translatable languages.

Return value

array Available sources indexed by project and language.

2 calls to locale_translation_check_projects()
LocaleController::checkTranslation in core/modules/locale/src/Controller/LocaleController.php
Checks for translation updates and displays the translations status.
locale_translation_manual_status in core/modules/locale/locale.pages.inc
Page callback: Checks for translation updates and displays the status.

File

core/modules/locale/locale.compare.inc, line 184

Code

function locale_translation_check_projects($projects = [], $langcodes = []) {
    if (locale_translation_use_remote_source()) {
        // Retrieve the status of both remote and local translation sources by
        // using a batch process.
        locale_translation_check_projects_batch($projects, $langcodes);
    }
    else {
        // Retrieve and save the status of local translations only.
        locale_translation_check_projects_local($projects, $langcodes);
        \Drupal::state()->set('locale.translation_last_checked', REQUEST_TIME);
    }
}

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