locale_translation_update_file_history

locale_translation_update_file_history($file)

Updates the {locale_file} table.

Parameters

object $file: Object representing the file just imported.

Return value

int FALSE on failure. Otherwise SAVED_NEW or SAVED_UPDATED.

File

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

Code

function locale_translation_update_file_history($file) {
  $status = db_merge('locale_file')
    ->key(array(
      'project' => $file->project,
      'langcode' => $file->langcode,
    ))
    ->fields(array(
      'version' => $file->version,
      'timestamp' => $file->timestamp,
      'last_checked' => $file->last_checked,
    ))
    ->execute();
  // The file history has changed, flush the static cache now.
  // @todo Can we make this more fine grained?
  drupal_static_reset('locale_translation_get_file_history');
  return $status;
}
doc_Drupal
2016-10-29 09:24:29
Comments
Leave a Comment

Please login to continue.