W3cubDocs

/Drupal 8

function 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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!locale!locale.module/function/locale_translation_update_file_history/8.1.x