Reduce calls to i18n.default_config

This commit is contained in:
Damian Mooyman 2017-08-21 17:21:12 +12:00 committed by Sam Minnée
parent 179a9fca28
commit 598a2c91e3

View File

@ -350,7 +350,10 @@ class i18n implements TemplateGlobalProvider
*/ */
public static function get_locale() public static function get_locale()
{ {
return self::$current_locale ?: i18n::config()->uninherited('default_locale'); if (!self::$current_locale) {
self::$current_locale = i18n::config()->uninherited('default_locale');
}
return self::$current_locale;
} }
/** /**