Closed Kuse-GmbH closed 3 years ago
I can't reproduce this, fallback_locale works fine for me.
ok. I will test it on a clean new installation with only this plugin tomorrow and I'll give feedback thanks
ops. I posted with a different account before. sorry for this.
Just to clarify, I tried to reproduce with 'locale' => 'fr' and 'fallback_locale => 'en' with a plugin of mine with missing FR strings localizations and the EN version was used (as a fallback).
Just tried with gromit.sentmails
and was able to reproduce... I'll report what I find in a few minutes.
Ok, I found the problem: the plugin is using RainLab.Translate instead of Laravel for its localization... i.e.
public function registerNavigation(): array
{
return [
'sentmails' => [
'label' => __('gromit.sentmails::lang.menu_label'),
'url' => Backend::url('gromit/sentmails/mails'),
'icon' => 'icon-envelope-open',
'permissions' => ['gromit.sentmails.*'],
'order' => 500,
],
];
}
Note: the plugin should be using this instead:
public function registerNavigation(): array
{
return [
'sentmails' => [
'label' => 'gromit.sentmails::lang.menu_label',
'url' => Backend::url('gromit/sentmails/mails'),
'icon' => 'icon-envelope-open',
'permissions' => ['gromit.sentmails.*'],
'order' => 500,
],
];
}
ALL INSTANCES should be replaced in Plugin.php for this to work (everywhere __()
is used)
I want to migrate this plugin with some new features to winterCMS. Then I replace the translations, too
Is it one of your plugins?
I submitted a PR to address the issues:
Description:
'fallback_locale' => 'en' will be ignored in backend mainmenu
I use 'locale' => 'de' in my installation and a plugin gromit.sentmails (there is only one plugin without german translation installed) and in mainmenu there is the translation string:
at the top there is a screenshot from winterCMS (booth testet, web installer and composer install), at the bottom an nearly identical oc-install (latest v1)
Steps To Reproduce:
in app.php: 'locale' => 'de', 'fallback_locale' => 'en',
Install gromit.sentmails