diff --git a/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php b/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php index 9726ef8..e13b298 100644 --- a/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php +++ b/core/modules/locale/lib/Drupal/locale/Tests/LocaleFileImportStatus.php @@ -39,7 +39,6 @@ class LocaleFileImportStatus extends WebTestBase { * The language of the langcode to add. */ function addLanguage($langcode) { - // Add language. $edit = array('predefined_langcode' => $langcode); $this->drupalPost('admin/config/regional/language/add', $edit, t('Add language')); drupal_static_reset('language_list'); @@ -47,10 +46,10 @@ class LocaleFileImportStatus extends WebTestBase { } /** - * Get translations for a array of strings. + * Get translations for an array of strings. * * @param $strings - * A array of strings to translate. + * An array of strings to translate. * @param $langcode * The language code of the language to translate to. */ @@ -132,7 +131,7 @@ class LocaleFileImportStatus extends WebTestBase { ); $this->checkTranslations($strings, $langcode); - // Fill the {locale_file} table with a older file. + // Fill the {locale_file} table with an older file. $file = $this->mockImportedPoFile($langcode, -1); // Add language. diff --git a/core/modules/locale/locale.bulk.inc b/core/modules/locale/locale.bulk.inc index 1844473..3ae0d02 100644 --- a/core/modules/locale/locale.bulk.inc +++ b/core/modules/locale/locale.bulk.inc @@ -393,18 +393,21 @@ function locale_translate_update_file_history($file) { */ 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; + $return = FALSE; + } + else { + // Remove the registered translation file if any. + db_delete('locale_file') + ->condition('langcode', $langcode) + ->coddition('uri', $file->uri) + ->execute(); } - // Remove the registered translation file if any. - db_delete('locale_file') - ->condition('langcode', $langcode) - ->coddition('uri', $file->uri) - ->execute(); } } - return TRUE; + return $return; }