From 598a2c91e3c91355bbe319cb86f556fcec56bd5c Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Mon, 21 Aug 2017 17:21:12 +1200 Subject: [PATCH] Reduce calls to i18n.default_config --- src/i18n/i18n.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/i18n/i18n.php b/src/i18n/i18n.php index 5990af046..ce0cf8375 100644 --- a/src/i18n/i18n.php +++ b/src/i18n/i18n.php @@ -350,7 +350,10 @@ class i18n implements TemplateGlobalProvider */ 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; } /**