You are here

function l10n_update_cron in Localization update 6

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

Implementation of hook_cron().

Check one project/language at a time, download and import if update available

File

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

Code

function l10n_update_cron() {
  if ($frequency = variable_get('l10n_update_check_frequency', 0)) {
    module_load_include('check.inc', 'l10n_update');
    list($checked, $updated) = l10n_update_check_translations(L10N_UPDATE_CRON_PROJECTS, time() - $frequency * 24 * 3600, L10N_UPDATE_CRON_UPDATES);
    watchdog('l10n_update', 'Automatically checked @checked translations, updated @updated.', array(
      '@checked' => count($checked),
      '@updated' => count($updated),
    ));
  }
}