// If the status was updated recently we can immediately start fetching the
// translation updates. If the status is expired we clear it and run a batch
// to update the status and then fetch the translation updates.
$last_checked =
$this->state->
get('locale.translation_last_checked'
);
if ($last_checked < REQUEST_TIME - LOCALE_TRANSLATION_STATUS_TTL
) { locale_translation_clear_status();
$batch =
locale_translation_batch_update_build([],
$langcodes,
$options);
batch_set($batch);
} else { // Set a batch to download and import translations.
$batch =
locale_translation_batch_fetch_build($projects,
$langcodes,
$options);
batch_set($batch);
// Set a batch to update configuration as well.
if ($batch =
locale_config_batch_update_components($options,
$langcodes)) { batch_set($batch);
} } }}