function l10n_update_batch_status_build in Localization update 7.2
Builds a batch to get the status of remote and local translation files.
The batch process fetches the state of both local and (if configured) remote translation files. The data of the most recent translation is stored per per project and per language. This data is stored in a state variable 'l10n_update_translation_status'. The timestamp it was last updated is stored in the state variable 'l10n_upate_last_checked'.
Parameters
array $projects: Array of project names for which to check the state of translation files. Defaults to all translatable projects.
array $langcodes: Array of language codes. Defaults to all translatable languages.
Return value
array Batch definition array.
1 call to l10n_update_batch_status_build()
- l10n_update_check_projects_batch in ./
l10n_update.compare.inc - Gets and stores the status and timestamp of remote po files.
File
- ./
l10n_update.compare.inc, line 310 - The API for comparing project translation status with available translation.
Code
function l10n_update_batch_status_build($projects = array(), $langcodes = array()) {
$projects = $projects ? $projects : array_keys(l10n_update_get_projects());
$langcodes = $langcodes ? $langcodes : array_keys(l10n_update_translatable_language_list());
$options = _l10n_update_default_update_options();
$operations = _l10n_update_batch_status_operations($projects, $langcodes, $options);
$batch = array(
'operations' => $operations,
'title' => t('Checking translations'),
'progress_message' => '',
'finished' => 'l10n_update_batch_status_finished',
'error_message' => t('Error checking translation updates.'),
'file' => drupal_get_path('module', 'l10n_update') . '/l10n_update.batch.inc',
);
return $batch;
}