From 1c0bfa8f34124c485de65e1268080cd9625f18ff Mon Sep 17 00:00:00 2001 From: Jose Lorenzo Rodriguez Date: Thu, 5 Feb 2015 09:33:51 -0430 Subject: [PATCH] Lazily setting locale name to translators. This helps prevent fatal errors during boostrap when cache engines are not yet configured. --- src/I18n/I18n.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/I18n/I18n.php b/src/I18n/I18n.php index b920318aa3b..07832329f8d 100644 --- a/src/I18n/I18n.php +++ b/src/I18n/I18n.php @@ -215,7 +215,9 @@ public static function locale($locale = null) if (!empty($locale)) { Locale::setDefault($locale); - static::translators()->setLocale($locale); + if (isset(static::$_collection)) { + static::translators()->setLocale($locale); + } return; }