mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR i18n::_t() getter performance optimisation (saves 10% on default CMS execution!)
This commit is contained in:
parent
03de6e5e5f
commit
27ec83ce40
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user