function locale_translation_status_save

Saves the status of translation sources in static cache.

Parameters

array $data: Array of translation source data, structured by project name and langcode.

2 calls to locale_translation_status_save()
locale_translation_batch_status_compare in drupal/core/modules/locale/locale.batch.inc
Batch operation callback: Compare states and store the result.
locale_translation_check_projects_local in drupal/core/modules/locale/locale.compare.inc
Check and store the status and timestamp of local po files.

File

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

Code

function locale_translation_status_save($data) {

  // Followup issue: http://drupal.org/node/1842362
  // Split status storage per module/language and expire individually. This will
  // improve performance for large sites.
  $status = Drupal::state()
    ->get('locale.translation_status');
  $status = empty($status) ? array() : $status;

  // Merge the new data into the existing structured status array.
  foreach ($data as $project => $languages) {
    foreach ($languages as $langcode => $source) {
      $status[$project][$langcode] = $source;
    }
  }
  Drupal::state()
    ->set('locale.translation_status', $status);
  Drupal::state()
    ->set('locale.translation_last_checked', REQUEST_TIME);
}