Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LocaleHooks.php

function LocaleHooks::cron

Implements hook_cron().

See also

\Drupal\locale\Plugin\QueueWorker\LocaleTranslation

File

core/modules/locale/src/Hook/LocaleHooks.php, line 198

Class

LocaleHooks
Hook implementations for locale.

Namespace

Drupal\locale\Hook

Code

public function cron() : void {
    // 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();
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal