You are here

function l10n_update_get_project_name in Localization update 7.2

Same name and namespace in other branches
  1. 6 l10n_update.project.inc \l10n_update_get_project_name()
  2. 7 l10n_update.project.inc \l10n_update_get_project_name()

Given a file object figure out what project it belongs to.

Uses a file object as returned by system_rebuild_module_data(). Based on update_get_project_name().

Parameters

object $file: Project info file object.

Return value

string The project's machine name this file belongs to.

See also

system_get_files_database()

update_get_project_name()

1 call to l10n_update_get_project_name()
_l10n_update_project_info_list in ./l10n_update.compare.inc
Populate an array of project data.

File

./l10n_update.compare.inc, line 224
The API for comparing project translation status with available translation.

Code

function l10n_update_get_project_name($file) {
  $project_name = '';
  if (isset($file->info['project'])) {
    $project_name = $file->info['project'];
  }
  elseif (isset($file->info['package']) && strpos($file->info['package'], 'Core') === 0) {
    $project_name = 'drupal';
  }
  return $project_name;
}