Downloads source file from a remote server.
The downloaded file is stored in the temporary files directory.
object $source_file: Source file object with at least:
object File object if download was successful. FALSE on failure.
function locale_translation_download_source($source_file) {
if ($uri = system_retrieve_file($source_file->uri, 'temporary://')) {
$file = new stdClass();
$file->project = $source_file->project;
$file->langcode = $source_file->langcode;
$file->version = $source_file->version;
$file->type = LOCALE_TRANSLATION_DOWNLOADED;
$file->uri = $uri;
$file->filename = $source_file->filename;
return $file;
}
watchdog('locale', 'Unable to download translation file @uri.', array(
'@uri' => $source->files[LOCALE_TRANSLATION_REMOTE]->uri,
), WATCHDOG_ERROR);
return FALSE;
}