Get array of projects which are available for interface translation.
This project data contains all projects which will be checked for available interface translations.
For full functionality this function depends on Update module. When Update module is enabled the project data will contain the most recent module status; both in enabled status as in version. When Update module is disabled this function will return the last known module state. The status will only be updated once Update module is enabled.
array Array of project data for translation update. See locale_translation_build_projects() for details.
locale_translation_build_projects().
function locale_translation_get_projects() {
$projects =& drupal_static(__FUNCTION__, array());
if (empty($projects)) {
// Get project data from the database.
$result = db_query('SELECT name, project_type, core, version, server_pattern, status FROM {locale_project}');
// http://drupal.org/node/1777106 is a follow-up issue to make the check for
// possible out-of-date project information more robust.
if ($result
->rowCount() == 0 && module_exists('update')) {
// At least the core project should be in the database, so we build the
// data if none are found.
locale_translation_build_projects();
$result = db_query('SELECT name, project_type, core, version, server_pattern, status FROM {locale_project}');
}
foreach ($result as $project) {
$projects[$project->name] = $project;
}
}
return $projects;
}