function locale_translation_update_file_history

Updates the {locale_file} table.

Parameters

object $file: Object representing the file just imported.

Return value

integer FALSE on failure. Otherwise SAVED_NEW or SAVED_UPDATED.

See also

drupal_write_record()

2 calls to locale_translation_update_file_history()
locale_translate_batch_import_save in drupal/core/modules/locale/locale.bulk.inc
Batch callback: Save data of imported files.
locale_translation_batch_fetch_update_status in drupal/core/modules/locale/locale.batch.inc
Batch process: Update the download history table.

File

drupal/core/modules/locale/locale.module, line 848
Enables the translation of the user interface to languages other than English.

Code

function locale_translation_update_file_history($file) {

  // Update or write new record.
  if (db_query("SELECT project FROM {locale_file} WHERE project = :project AND langcode = :langcode", array(
    ':project' => $file->project,
    ':langcode' => $file->langcode,
  ))
    ->fetchField()) {
    $update = array(
      'project',
      'langcode',
    );
  }
  else {
    $update = array();
  }
  return drupal_write_record('locale_file', $file, $update);
}