Fix caching of parent locales file in translator

This commit is contained in:
Jérôme 2020-06-29 15:31:43 +02:00 committed by GitHub
parent 27290714b7
commit 02c9ac68a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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;