function l10n_update_delete_translation_files in Localization update 7.2
Deletes interface translation files and translation history records.
Parameters
array $projects: Project names from which to delete the translation files and history. Defaults to all projects.
array $langcodes: Language codes from which to delete the translation files and history. Defaults to all languages.
Return value
bool TRUE if files are removed successfully. FALSE if one or more files could not be deleted.
1 call to l10n_update_delete_translation_files()
- l10n_update_system_remove in ./
l10n_update.module - Delete translation history of modules and themes.
File
- ./
l10n_update.bulk.inc, line 728 - Mass import-export and batch import functionality for Gettext .po files.
Code
function l10n_update_delete_translation_files($projects = array(), $langcodes = array()) {
$fail = FALSE;
l10n_update_file_history_delete($projects, $langcodes);
// Delete all translation files from the translations directory.
if ($files = l10n_update_get_interface_translation_files($projects, $langcodes)) {
foreach ($files as $file) {
$success = file_unmanaged_delete($file->uri);
if (!$success) {
$fail = TRUE;
}
}
}
return !$fail;
}