Skip to content

Commit

Permalink
Lazily setting locale name to translators.
Browse files Browse the repository at this point in the history
This helps prevent fatal errors during boostrap when cache engines are
not yet configured.
  • Loading branch information
lorenzo committed Feb 5, 2015
1 parent 74b97c7 commit 1c0bfa8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/I18n/I18n.php
Expand Up @@ -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;
}

Expand Down

0 comments on commit 1c0bfa8

Please sign in to comment.