mirror of
https://github.com/flarum/framework.git
synced 2025-02-06 10:13:17 +08:00
Get translations from fallback catalogues (#1961)
This commit is contained in:
parent
152951f81b
commit
d0a23b756c
|
@ -53,7 +53,12 @@ class AddTranslations
|
||||||
|
|
||||||
private function getTranslations(string $locale)
|
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(
|
return Arr::only(
|
||||||
$translations,
|
$translations,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user