Skip to content

Commit

Permalink
Fix fallback mechanism for ICU translations (pimcore#17057)
Browse files Browse the repository at this point in the history
  • Loading branch information
dolmit-tanel-paaro authored Oct 4, 2024
1 parent 40d5554 commit 84d9f9f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Translation/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,11 @@ private function checkForEmptyTranslation(string $id, string $translated, array
}

if ($fallbackValue && $normalizedId != $fallbackValue) {
$isIntl = $catalogue->defines($normalizedId, $domain . $catalogue::INTL_DOMAIN_SUFFIX);
// update fallback value in original catalogue otherwise multiple calls to the same id will not work
$this->getCatalogue($locale)->set($normalizedId, $fallbackValue, $domain);
$this->getCatalogue($locale)->set($normalizedId, $fallbackValue, $domain . ($isIntl ? $catalogue::INTL_DOMAIN_SUFFIX : ''));

return strtr($fallbackValue, $parameters);
return $this->translator->trans($normalizedId, $parameters, $domain, $locale);
}
}
}
Expand Down

0 comments on commit 84d9f9f

Please sign in to comment.