Skip to content

Commit

Permalink
Merge branch '5.0' into 5.1
Browse files Browse the repository at this point in the history
* 5.0:
  [ErrorHandler] fix throwing from __toString()
  Removed comments and requirements relative to php <5.5 (not supported anymore)
  Fix caching of parent locales file in translator
  fix validating lazy properties that evaluate to null
  • Loading branch information
nicolas-grekas committed Jun 30, 2020
2 parents d387f07 + 762090e commit 4b9bf71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Translator.php
Expand Up @@ -397,7 +397,7 @@ private function loadFallbackCatalogues(string $locale): void
protected function computeFallbackLocales(string $locale)
{
if (null === $this->parentLocales) {
$parentLocales = json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true);
$this->parentLocales = json_decode(file_get_contents(__DIR__.'/Resources/data/parents.json'), true);
}

$locales = [];
Expand All @@ -410,7 +410,7 @@ protected function computeFallbackLocales(string $locale)
}

while ($locale) {
$parent = $parentLocales[$locale] ?? null;
$parent = $this->parentLocales[$locale] ?? null;

if ($parent) {
$locale = 'root' !== $parent ? $parent : null;
Expand Down

0 comments on commit 4b9bf71

Please sign in to comment.