function locale_translate_update_file_history

Update the {locale_file} table.

Parameters

$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_translate_update_file_history()
LocaleFileImportStatus::mockImportedPoFile in drupal/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php
Import a single interface translation file.
locale_translate_batch_import in drupal/core/modules/locale/locale.bulk.inc
Perform interface translation import as a batch step.

File

drupal/core/modules/locale/locale.bulk.inc, line 593
Mass import-export and batch import functionality for Gettext .po files.

Code

function locale_translate_update_file_history($file) {

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