From de06fd66ee7d01832ff08f13d58e21a9d7a510c7 Mon Sep 17 00:00:00 2001 From: Matthieu Napoli Date: Mon, 29 Dec 2014 20:03:26 +1300 Subject: Refactored the way translations are loaded Translations are now lazily loaded instead of being explicitely loaded by other components (e.g. the front controller, the plugin manager, etc...). Now other parties only configure "directories" where the translator can find translations. That makes the translator decoupled from the rest of Piwik. --- core/FrontController.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'core/FrontController.php') diff --git a/core/FrontController.php b/core/FrontController.php index 8e7c91a0bc..89e91b943b 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -324,17 +324,13 @@ class FrontController extends Singleton $tmpPath . '/templates_c/', ); - Translate::loadEnglishTranslation(); - Filechecks::dieIfDirectoriesNotWritable($directoriesToCheck); $this->handleMaintenanceMode(); $this->handleProfiler(); $this->handleSSLRedirection(); - /** @var Translator $translator */ - $translator = StaticContainer::getContainer()->get('Piwik\Translation\Translator'); - $translator->loadPluginsTranslations('en'); + Plugin\Manager::getInstance()->loadPluginTranslations(); Plugin\Manager::getInstance()->loadActivatedPlugins(); if ($exceptionToThrow) { -- cgit v1.2.3