Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

// Also clear language cache in AdminTranslationsController

  • Loading branch information...
commit fcdc9db6249509074a2aeb618f82743b8d38b932 1 parent eda7758
@rGaillard rGaillard authored
Showing with 24 additions and 14 deletions.
  1. +24 −14 controllers/admin/AdminTranslationsController.php
View
38 controllers/admin/AdminTranslationsController.php
@@ -687,18 +687,25 @@ public function submitImportLang()
if (pathinfo($file2check['filename'], PATHINFO_BASENAME) == 'index.php' && file_put_contents(_PS_TRANSLATIONS_DIR_.'../'.$file2check['filename'], Tools::getDefaultIndexContent()))
continue;
- AdminTranslationsController::checkAndAddMailsFiles($iso_code, $files_list);
- $this->checkAndAddThemesFiles($files_list, $themes_selected);
- $tab_errors = AdminTranslationsController::addNewTabs($iso_code, $files_list);
- if (count($tab_errors))
- {
- $this->errors += $tab_errors;
- return false;
- }
if (Validate::isLanguageFileName($filename))
{
if (!Language::checkAndAddLanguage($iso_code))
$conf = 20;
+ else
+ {
+ // Reset cache
+ Language::loadLanguages();
+
+ AdminTranslationsController::checkAndAddMailsFiles($iso_code, $files_list);
+ $this->checkAndAddThemesFiles($files_list, $themes_selected);
+ $tab_errors = AdminTranslationsController::addNewTabs($iso_code, $files_list);
+
+ if (count($tab_errors))
+ {
+ $this->errors += $tab_errors;
+ return false;
+ }
+ }
}
$this->redirect(false, (isset($conf) ? $conf : '15'));
}
@@ -729,14 +736,17 @@ public function submitAddLang()
$this->errors[] = Tools::displayError('The archive cannot be extracted.'). ' '.$error->message;
else
{
- AdminTranslationsController::checkAndAddMailsFiles($arr_import_lang[0], $files_list);
- $tab_errors = AdminTranslationsController::addNewTabs($arr_import_lang[0], $files_list);
- if (count($tab_errors))
- $this->errors += $tab_errors;
+
+ if (!Language::checkAndAddLanguage($arr_import_lang[0]))
+ $conf = 20;
else
{
- if (!Language::checkAndAddLanguage($arr_import_lang[0]))
- $conf = 20;
+ // Reset cache
+ Language::loadLanguages();
+
+ AdminTranslationsController::checkAndAddMailsFiles($arr_import_lang[0], $files_list);
+ if ($tab_errors = AdminTranslationsController::addNewTabs($arr_import_lang[0], $files_list))
+ $this->errors += $tab_errors;
}
if (!unlink($file))
$this->errors[] = sprintf(Tools::displayError('Cannot delete the archive %s.'), $file);
Please sign in to comment.
Something went wrong with that request. Please try again.