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 646fef1 commit 3c0fbd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Providers/MenuServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Support\ServiceProvider;
use Modules\Core\Events\BuildingSidebar;
use Modules\Core\Events\LoadingBackendTranslations;
use Modules\Core\Traits\CanGetSidebarClassForModule;
use Modules\Core\Traits\CanPublishConfiguration;
use Modules\Menu\Blade\MenuDirective;
Expand Down Expand Up @@ -47,6 +48,11 @@ public function register()
BuildingSidebar::class,
$this->getSidebarClassForModule('menu', RegisterMenuSidebar::class)
);

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

/**
Expand Down

0 comments on commit 3c0fbd3

Please sign in to comment.