You are here

function locale_translation_file_history_delete in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/locale/locale.module \locale_translation_file_history_delete()
  2. 10 core/modules/locale/locale.module \locale_translation_file_history_delete()

Deletes the history of downloaded translations.

Parameters

array $projects: Project name(s) to be deleted from the file history. If both project(s) and language code(s) are specified the conditions will be ANDed.

array $langcodes: Language code(s) to be deleted from the file history.

2 calls to locale_translation_file_history_delete()
locale_system_remove in core/modules/locale/locale.module
Delete translation history of modules and themes.
locale_translate_delete_translation_files in core/modules/locale/locale.bulk.inc
Deletes interface translation files and translation history records.

File

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

Code

function locale_translation_file_history_delete($projects = [], $langcodes = []) {
  $query = \Drupal::database()
    ->delete('locale_file');
  if (!empty($projects)) {
    $query
      ->condition('project', $projects, 'IN');
  }
  if (!empty($langcodes)) {
    $query
      ->condition('langcode', $langcodes, 'IN');
  }
  $query
    ->execute();
}