function locale_translate_delete_translation_files

Deletes all interface translation files depending on the langcode.

Parameters

$langcode: A langcode or NULL. Pass NULL to delete all interface translation files.

1 call to locale_translate_delete_translation_files()
locale_language_delete in drupal/core/modules/locale/locale.module
Implements hook_language_delete().

File

drupal/core/modules/locale/locale.bulk.inc, line 610
Mass import-export and batch import functionality for Gettext .po files.

Code

function locale_translate_delete_translation_files($langcode) {
  $files = locale_translate_get_interface_translation_files($langcode);
  $return = TRUE;
  if (!empty($files)) {
    foreach ($files as $file) {
      $success = file_unmanaged_delete($file->uri);
      if (!$success) {
        $return = FALSE;
      }
      else {

        // Remove the registered translation file if any.
        db_delete('locale_file')
          ->condition('langcode', $langcode)
          ->condition('uri', $file->uri)
          ->execute();
      }
    }
  }
  return $return;
}