Skip to content

Commit

Permalink
Hooking into loading backend translations hook for each module
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Oct 16, 2017
1 parent c4bc101 commit 1d19681
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Providers/TranslationServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Support\ServiceProvider;
use Modules\Core\Composers\CurrentUserViewComposer;
use Modules\Core\Events\BuildingSidebar;
use Modules\Core\Events\LoadingBackendTranslations;
use Modules\Core\Traits\CanGetSidebarClassForModule;
use Modules\Core\Traits\CanPublishConfiguration;
use Modules\Translation\Console\BuildTranslationsCacheCommand;
Expand Down Expand Up @@ -45,6 +46,10 @@ public function register()
BuildingSidebar::class,
$this->getSidebarClassForModule('translation', RegisterTranslationSidebar::class)
);

$this->app['events']->listen(LoadingBackendTranslations::class, function (LoadingBackendTranslations $event) {
$event->load('translations', array_dot(trans('translation::translations')));
});
}

public function boot()
Expand Down

0 comments on commit 1d19681

Please sign in to comment.