[Contracts][Translation] Optional Intl dependency

This commit is contained in:
Roland Franssen 2020-09-23 21:16:49 +02:00 committed by GitHub
parent 50f37f0ccc
commit d65d39da14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,7 +35,7 @@ trait TranslatorTrait
*/
public function getLocale()
{
return $this->locale ?: \Locale::getDefault();
return $this->locale ?: (class_exists(\Locale::class) ? \Locale::getDefault() : 'en');
}
/**