From 02c9ac68a4fb5e0a5223aa9528ef8eb1dcfaf996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me?= Date: Mon, 29 Jun 2020 15:31:43 +0200 Subject: [PATCH] Fix caching of parent locales file in translator --- src/Symfony/Component/Translation/Translator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Translation/Translator.php b/src/Symfony/Component/Translation/Translator.php index b404b54919..c4c58f054d 100644 --- a/src/Symfony/Component/Translation/Translator.php +++ b/src/Symfony/Component/Translation/Translator.php @@ -460,7 +460,7 @@ EOF protected function computeFallbackLocales($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 = []; @@ -473,7 +473,7 @@ EOF } while ($locale) { - $parent = $parentLocales[$locale] ?? null; + $parent = $this->parentLocales[$locale] ?? null; if ($parent) { $locale = 'root' !== $parent ? $parent : null;