1
0
mirror of https://github.com/flarum/core.git synced 2025-08-05 07:57:46 +02:00

Get translations from fallback catalogues (#1961)

This commit is contained in:
Julian Berger
2020-01-17 23:37:50 +01:00
committed by Daniël Klabbers
parent f99f48b155
commit 6b916065e9

View File

@@ -53,7 +53,12 @@ class AddTranslations
private function getTranslations(string $locale)
{
$translations = $this->locales->getTranslator()->getCatalogue($locale)->all('messages');
$catalogue = $this->locales->getTranslator()->getCatalogue($locale);
$translations = $catalogue->all('messages');
while ($catalogue = $catalogue->getFallbackCatalogue()) {
$translations = array_replace($catalogue->all('messages'), $translations);
}
return Arr::only(
$translations,