diff --git a/core/FrontController.php b/core/FrontController.php index 8a8949ad2cb8ea5429bee8b66e282d68474715c0..3c1fb601ce8e7e1499c634c60df09d5316729850 100644 --- a/core/FrontController.php +++ b/core/FrontController.php @@ -313,7 +313,7 @@ class FrontController extends Singleton Filechecks::dieIfDirectoriesNotWritable($directoriesToCheck); Translate::loadEnglishTranslation(); - Plugin\Manager::getInstance()->loadPluginTranslations(); + Plugin\Manager::getInstance()->loadPluginTranslations('en'); $exceptionToThrow = self::createConfigObject(); diff --git a/core/Plugin/Manager.php b/core/Plugin/Manager.php index 17c056cba65716801c272a966fbfcd9f3b2ca04f..6a9537df1f4fb7166907cd7250491ffe56132430 100644 --- a/core/Plugin/Manager.php +++ b/core/Plugin/Manager.php @@ -650,9 +650,18 @@ class Manager extends Singleton $language = Translate::getLanguageToLoad(); } - $cache = new CacheFile('tracker', 43200); // ttl=12hours - $cacheKey = 'PluginTranslations-' . $language; - $cacheKey .= '-' . md5(implode('', $this->getLoadedPluginsName())); // makes sure to create a translation in case loaded plugins change (ie Tests vs Tracker vs UI etc) + $cache = new CacheFile('tracker', 43200); // ttl=12hours + $cacheKey = 'PluginTranslations'; + + if (!empty($language)) { + $cacheKey .= '-' . trim($language); + } + + if (!empty($this->loadedPlugins)) { + // makes sure to create a translation in case loaded plugins change (ie Tests vs Tracker vs UI etc) + $cacheKey .= '-' . md5(implode('', $this->getLoadedPluginsName())); + } + $translations = $cache->get($cacheKey); if (!empty($translations) && @@ -1015,7 +1024,10 @@ class Manager extends Singleton } // merge in specific language translations (to overwrite english defaults) - if ($defaultEnglishLangPath != $defaultLangPath && file_exists($defaultLangPath)) { + if (!empty($langCode) && + $defaultEnglishLangPath != $defaultLangPath && + file_exists($defaultLangPath)) { + $translations = $this->getTranslationsFromFile($defaultLangPath); $translationsLoaded = true; if (isset($translations[$pluginName])) {