You are here

function l10n_update_finish_d8_plural_strings in Localization update 7.2

Clean-up after plural string conversion.

Parameters

array $results: Batch results array.

1 call to l10n_update_finish_d8_plural_strings()
l10n_update_update_7207 in ./l10n_update.install
Migrate D8 style plurals to D7 style.

File

./l10n_update.install, line 419
Install file for l10n remote updates.

Code

function l10n_update_finish_d8_plural_strings($results) {
  require_once DRUPAL_ROOT . '/includes/locale.inc';
  if ($results) {

    // Delete converted D8 style translations.
    if (isset($results['lids'])) {
      foreach ($results['lids'] as $lids) {
        db_delete('locales_source')
          ->condition('lid', $lids)
          ->execute();
        db_delete('locales_target')
          ->condition('lid', $lids)
          ->execute();
      }
    }

    // Clear caches if translations are modified.
    if (isset($results['languages'])) {
      cache_clear_all('locale:', 'cache', TRUE);
      foreach ($results['languages'] as $langcode) {
        _locale_invalidate_js($langcode);
      }
    }
  }
}