function locale_system_remove

Delete translation history of modules and themes.

Only the translation history is removed, not the source strings or translations. This is not possible because strings are shared between modules and we have no record of which string is used by which module.

Parameters

array $components: An array of arrays of component (theme and/or module) names to import translations for, indexed by type.

2 calls to locale_system_remove()
locale_modules_uninstalled in drupal/core/modules/locale/locale.module
Implements hook_modules_uninstalled().
locale_themes_disabled in drupal/core/modules/locale/locale.module
Implements hook_themes_disabled().

File

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

Code

function locale_system_remove($components) {
  $components += array(
    'module' => array(),
    'theme' => array(),
  );
  $list = array_merge($components['module'], $components['theme']);
  if ($language_list = locale_translatable_language_list()) {
    module_load_include('compare.inc', 'locale');
    Drupal::moduleHandler()
      ->loadInclude('locale', 'bulk.inc');

    // Delete configuration translations.
    \Drupal\locale\Locale::config()
      ->deleteComponentTranslations($components, array_keys($language_list));

    // Only when projects are removed, the translation files and records will be
    // deleted. Not each disabled module will remove a project. E.g. sub modules.
    $projects = array_keys(locale_translation_get_projects());
    if ($list = array_intersect($list, $projects)) {
      locale_translation_file_history_delete($list);

      // Remove translation files.
      locale_translate_delete_translation_files($list, array());

      // Remove translatable projects.
      // Followup issue http://drupal.org/node/1842362 to replace the
      // {locale_project} table. Then change this to a function call.
      db_delete('locale_project')
        ->condition('name', $list)
        ->execute();

      // Clear the translation status.
      locale_translation_status_delete_projects($list);
    }
  }
}