You are here

function l10n_update_source_build in Localization update 7

Same name and namespace in other branches
  1. 6 l10n_update.check.inc \l10n_update_source_build()
  2. 7.2 l10n_update.translation.inc \l10n_update_source_build()

Build abstract translation source, to be mapped to a file or a download.

Parameters

$project: Project object.

$langcode: Language code.

$filename: File name of translation file. May contains placeholders.

Return value

object Source object, which may have these properties:

  • 'project': Project name.
  • 'language': Language code.
  • 'type': Source type 'download' or 'localfile'.
  • 'uri': Local file path.
  • 'fileurl': Remote file URL for downloads.
  • 'filename': File name.
  • 'keep': TRUE to keep the downloaded file.
  • 'timestamp': Last update time of the file.
2 calls to l10n_update_source_build()
l10n_update_check_projects in ./l10n_update.check.inc
Check latest release for project, language.
l10n_update_check_translations in ./l10n_update.check.inc
Check updates for active projects and languages.

File

./l10n_update.check.inc, line 203
Reusable API for l10n remote updates using $source objects

Code

function l10n_update_source_build($project, $langcode, $filename = L10N_UPDATE_DEFAULT_FILENAME) {
  $source = clone $project;
  $source->project = $project->name;
  $source->language = $langcode;
  $source->filename = l10n_update_build_string($source, $filename);
  return $source;
}