MINOR i18n::_t() getter performance optimisation (saves 10% on default CMS execution!)

This commit is contained in:
Ingo Schommer 2011-12-04 21:39:17 +01:00
parent 03de6e5e5f
commit 27ec83ce40

View File

@ -1464,7 +1464,11 @@ class i18n extends Object implements TemplateGlobalProvider {
$locale = i18n::get_locale();
$lang = i18n::get_lang_from_locale($locale);
foreach(self::get_translators() as $priority => $translators) {
// Only call getter if static isn't already defined (for performance reasons)
$translators = self::$translators;
if(!$translators) $translators = self::get_translators();
foreach($translators as $priority => $translators) {
foreach($translators as $name => $translator) {
$adapter = $translator->getAdapter();