Skip to content

Commit

Permalink
// just a check for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiix committed Nov 20, 2019
1 parent a8b9006 commit 7e19da9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
4 changes: 1 addition & 3 deletions classes/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,7 @@ public function getTranslatorFromLocale($locale)
(new Filesystem())->remove($cache_file);
}

// only way to reset the catalogue
$translator->addLoader('Array', new ArrayLoader());
$translator->addResource('Array', [], $locale);
$translator->resetLocale($locale);

$adminContext = defined('_PS_ADMIN_DIR_');
$withDB = !$this->language instanceof PrestashopBundle\Install\Language;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ interface PrestaShopTranslatorInterface extends TranslatorInterface
* @return bool
*/
public function isCatalogLoaded($locale);

/**
* @param $locale
*/
public function resetLocale($locale);
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ public function isCatalogLoaded($locale)
return !empty($this->catalogues[$locale]);
}

/**
* @param $locale
*/
public function resetLocale($locale)
{
unset($this->catalogues[$locale]);
unset($this->resources[$locale]);
}

/**
* @param string $string
*
Expand Down

0 comments on commit 7e19da9

Please sign in to comment.