Permalink
Browse files

[-] Core: clean Language:: after adding a new lang

  • Loading branch information...
rGaillard committed Mar 26, 2013
1 parent d5b41ba commit eda7758ab68689a7fdf856f5c3ef13b79c819f1b
Showing with 5 additions and 2 deletions.
  1. +5 −2 classes/Language.php
View
@@ -801,13 +801,16 @@ public static function downloadAndInstallLanguagePack($iso, $version = null, $pa
$files_list = $gz->listContent();
if (!$gz->extract(_PS_TRANSLATIONS_DIR_.'../', false))
$errors[] = Tools::displayError('Cannot decompress the translation file for the following language: ').(string)$iso;
+ if (!Language::checkAndAddLanguage((string)$iso, $lang_pack, false, $params))
+ $errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$iso;
else
{
+ // Reset cache
+ Language::loadLanguages();
+
AdminTranslationsController::checkAndAddMailsFiles($iso, $files_list);
AdminTranslationsController::addNewTabs($iso, $files_list);
}
- if (!Language::checkAndAddLanguage((string)$iso, $lang_pack, false, $params))
- $errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$iso;
@unlink($file);
}
else

0 comments on commit eda7758

Please sign in to comment.