You are here

function l10n_update_cron in Localization update 7.2

Same name and namespace in other branches
  1. 6 l10n_update.module \l10n_update_cron()
  2. 7 l10n_update.module \l10n_update_cron()

Implements hook_cron().

Checks interface translations. Downloads and imports updates when available.

1 call to l10n_update_cron()
L10nUpdateCronTest::testUpdateCron in tests/L10nUpdateCronTest.test
Tests interface translation update using cron.

File

./l10n_update.module, line 192
Download translations from remote localization server.

Code

function l10n_update_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
  // using the cron worker defined in l10n_update_queue_info().
  if ($frequency = variable_get('l10n_update_check_frequency', '0') && l10n_update_translatable_language_list()) {
    module_load_include('translation.inc', 'l10n_update');
    l10n_update_cron_fill_queue();
  }
}