function lingotek_check_for_l10n_translations in Lingotek Translation 7.5
Same name and namespace in other branches
- 7.4 lingotek.admin.inc \lingotek_check_for_l10n_translations()
2 calls to lingotek_check_for_l10n_translations()
File
- ./
lingotek.admin.inc, line 889
Code
function lingotek_check_for_l10n_translations($modules) {
// return the translations available through Drupal translation and a list of the ones still needed
module_load_include('project.inc', 'l10n_update');
module_load_include('check.inc', 'l10n_update');
$projects = array();
$available = array();
$updates = array();
// Get all current projects, including the recently installed.
$current_projects = l10n_update_build_projects(TRUE);
// Collect project data of newly installed projects.
foreach ($modules as $k => $v) {
if (isset($current_projects[$k])) {
$projects[$k] = $current_projects[$k];
}
}
// If a translation is available and if update is required, lets go.
if ($projects && ($available = l10n_update_check_projects($projects))) {
$history = l10n_update_get_history();
if ($updates = l10n_update_build_updates($history, $available)) {
module_load_include('batch.inc', 'l10n_update');
// Filter out updates in other languages. If no languages, all of them will be updated
$updates = _l10n_update_prepare_updates($updates);
}
}
return $updates;
}