locale_cron_fill_queue

function locale_cron_fill_queue

locale_cron_fill_queue()

Populate a queue with project to check for translation updates.

File

core/modules/locale/locale.translation.inc, line 325
Common API for interface translation.

Code

function locale_cron_fill_queue() {
  $updates = array();
  $config = \Drupal::config('locale.settings');

  // Determine which project+language should be updated.
  $last = REQUEST_TIME - $config->get('translation.update_interval_days') * 3600 * 24;
  $projects = \Drupal::service('locale.project')->getAll();
  $projects = array_filter($projects, function($project) {
    return $project['status'] == 1;
  });
  $files = db_select('locale_file', 'f')
    ->condition('f.project', array_keys($projects), 'IN')
    ->condition(