function locale_cron

Same name and namespace in other branches
  1. 9 core/modules/locale/locale.module \locale_cron()
  2. 8.9.x core/modules/locale/locale.module \locale_cron()

Implements hook_cron().

See also

\Drupal\locale\Plugin\QueueWorker\LocaleTranslation

1 call to locale_cron()
LocaleUpdateCronTest::testUpdateCron in core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php
Tests interface translation update using cron.

File

core/modules/locale/locale.module, line 355

Code

function locale_cron() {
  // Update translations only when an update frequency was set by the admin
  // and a translatable language was set.
  // Update tasks are added to the queue here but processed by Drupal's cron.
  if (\Drupal::config('locale.settings')->get('translation.update_interval_days') && locale_translatable_language_list()) {
    \Drupal::moduleHandler()->loadInclude('locale', 'inc', 'locale.translation');
    locale_cron_fill_queue();
  }
}

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