Skip to content

Commit

Permalink
[Translator] Optional Intl dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
ro0NL authored and fabpot committed Sep 24, 2020
1 parent f29e195 commit 0b8c4bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ public function setLocale($locale)
}

$this->assertValidLocale($locale);
$this->locale = $locale;
$this->locale = $locale ?? (class_exists(\Locale::class) ? \Locale::getDefault() : 'en');
}

/**
* {@inheritdoc}
*/
public function getLocale()
{
return $this->locale ?? \Locale::getDefault();
return $this->locale;
}

/**
Expand Down

0 comments on commit 0b8c4bb

Please sign in to comment.