You are here

function l10n_update_batch_import_save in Localization update 7.2

Batch callback: Save data of imported files.

Parameters

array $context: Contains a list of imported files.

1 string reference to 'l10n_update_batch_import_save'
l10n_update_batch_build in ./l10n_update.bulk.inc
Build a locale batch from an array of files.

File

./l10n_update.bulk.inc, line 521
Mass import-export and batch import functionality for Gettext .po files.

Code

function l10n_update_batch_import_save($context) {
  if (isset($context['results']['files'])) {
    foreach ($context['results']['files'] as $file) {

      // Update the file history if both project and version are known. This
      // table is used by the automated translation update function which tracks
      // translation status of module and themes in the system. Other
      // translation files are not tracked and are therefore not stored in this
      // table.
      if ($file->project && $file->version) {
        $file->last_checked = REQUEST_TIME;
        l10n_update_update_file_history($file);
      }
    }
    $context['message'] = t('Translations imported.');
  }
}