Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Platform
Commits
5a48554d
Unverified
Commit
5a48554d
authored
Oct 16, 2017
by
Nicolas Widart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hooking into loading backend translations hook for each module
parent
2951b67b
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
49 additions
and
0 deletions
+49
-0
CoreServiceProvider.php
Modules/Core/Providers/CoreServiceProvider.php
+5
-0
DashboardServiceProvider.php
Modules/Dashboard/Providers/DashboardServiceProvider.php
+5
-0
MediaServiceProvider.php
Modules/Media/Providers/MediaServiceProvider.php
+6
-0
MenuServiceProvider.php
Modules/Menu/Providers/MenuServiceProvider.php
+6
-0
SettingServiceProvider.php
Modules/Setting/Providers/SettingServiceProvider.php
+5
-0
TagServiceProvider.php
Modules/Tag/Providers/TagServiceProvider.php
+5
-0
TranslationServiceProvider.php
Modules/Translation/Providers/TranslationServiceProvider.php
+5
-0
UserServiceProvider.php
Modules/User/Providers/UserServiceProvider.php
+5
-0
WorkshopServiceProvider.php
Modules/Workshop/Providers/WorkshopServiceProvider.php
+7
-0
No files found.
Modules/Core/Providers/CoreServiceProvider.php
View file @
5a48554d
...
...
@@ -16,6 +16,7 @@ use Modules\Core\Console\PublishThemeAssetsCommand;
use
Modules\Core\Events\BuildingSidebar
;
use
Modules\Core\Events\EditorIsRendering
;
use
Modules\Core\Events\Handlers\RegisterCoreSidebar
;
use
Modules\Core\Events\LoadingBackendTranslations
;
use
Modules\Core\Foundation\Theme\ThemeManager
;
use
Modules\Core\Traits\CanGetSidebarClassForModule
;
use
Modules\Core\Traits\CanPublishConfiguration
;
...
...
@@ -87,6 +88,10 @@ class CoreServiceProvider extends ServiceProvider
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'core'
,
RegisterCoreSidebar
::
class
)
);
$this
->
app
[
'events'
]
->
listen
(
LoadingBackendTranslations
::
class
,
function
(
LoadingBackendTranslations
$event
)
{
$event
->
load
(
'core'
,
array_dot
(
trans
(
'core::core'
)));
$event
->
load
(
'sidebar'
,
array_dot
(
trans
(
'core::sidebar'
)));
});
}
/**
...
...
Modules/Dashboard/Providers/DashboardServiceProvider.php
View file @
5a48554d
...
...
@@ -4,6 +4,7 @@ namespace Modules\Dashboard\Providers;
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\Dashboard\Entities\Widget
;
...
...
@@ -44,6 +45,10 @@ class DashboardServiceProvider extends ServiceProvider
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'dashboard'
,
RegisterDashboardSidebar
::
class
)
);
$this
->
app
[
'events'
]
->
listen
(
LoadingBackendTranslations
::
class
,
function
(
LoadingBackendTranslations
$event
)
{
$event
->
load
(
'dashboard'
,
array_dot
(
trans
(
'dashboard::dashboard'
)));
});
}
public
function
boot
(
StylistThemeManager
$theme
)
...
...
Modules/Media/Providers/MediaServiceProvider.php
View file @
5a48554d
...
...
@@ -5,6 +5,7 @@ namespace Modules\Media\Providers;
use
Illuminate\Contracts\Events\Dispatcher
as
DispatcherContract
;
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\Media\Blade\MediaMultipleDirective
;
...
...
@@ -66,6 +67,11 @@ class MediaServiceProvider extends ServiceProvider
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'media'
,
RegisterMediaSidebar
::
class
)
);
$this
->
app
[
'events'
]
->
listen
(
LoadingBackendTranslations
::
class
,
function
(
LoadingBackendTranslations
$event
)
{
$event
->
load
(
'media'
,
array_dot
(
trans
(
'media::media'
)));
$event
->
load
(
'folders'
,
array_dot
(
trans
(
'media::folders'
)));
});
}
public
function
boot
(
DispatcherContract
$events
)
...
...
Modules/Menu/Providers/MenuServiceProvider.php
View file @
5a48554d
...
...
@@ -4,6 +4,7 @@ namespace Modules\Menu\Providers;
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
;
...
...
@@ -47,6 +48,11 @@ class MenuServiceProvider extends ServiceProvider
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'
)));
});
}
/**
...
...
Modules/Setting/Providers/SettingServiceProvider.php
View file @
5a48554d
...
...
@@ -5,6 +5,7 @@ namespace Modules\Setting\Providers;
use
Illuminate\Foundation\AliasLoader
;
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\Setting\Blade\SettingDirective
;
...
...
@@ -52,6 +53,10 @@ class SettingServiceProvider extends ServiceProvider
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'setting'
,
RegisterSettingSidebar
::
class
)
);
$this
->
app
[
'events'
]
->
listen
(
LoadingBackendTranslations
::
class
,
function
(
LoadingBackendTranslations
$event
)
{
$event
->
load
(
'settings'
,
array_dot
(
trans
(
'setting::settings'
)));
});
}
public
function
boot
()
...
...
Modules/Tag/Providers/TagServiceProvider.php
View file @
5a48554d
...
...
@@ -4,6 +4,7 @@ namespace Modules\Tag\Providers;
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\Tag\Blade\TagWidget
;
...
...
@@ -41,6 +42,10 @@ class TagServiceProvider extends ServiceProvider
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'tag'
,
RegisterTagSidebar
::
class
)
);
$this
->
app
[
'events'
]
->
listen
(
LoadingBackendTranslations
::
class
,
function
(
LoadingBackendTranslations
$event
)
{
$event
->
load
(
'tags'
,
array_dot
(
trans
(
'tag::tags'
)));
});
}
public
function
boot
()
...
...
Modules/Translation/Providers/TranslationServiceProvider.php
View file @
5a48554d
...
...
@@ -7,6 +7,7 @@ use Illuminate\Support\Facades\Validator;
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
;
...
...
@@ -45,6 +46,10 @@ class TranslationServiceProvider extends ServiceProvider
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
()
...
...
Modules/User/Providers/UserServiceProvider.php
View file @
5a48554d
...
...
@@ -6,6 +6,7 @@ use Cartalyst\Sentinel\Laravel\SentinelServiceProvider;
use
Illuminate\Support\Facades\Auth
;
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\User\Console\GrantModulePermissionsCommand
;
...
...
@@ -68,6 +69,10 @@ class UserServiceProvider extends ServiceProvider
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'user'
,
RegisterUserSidebar
::
class
)
);
$this
->
app
[
'events'
]
->
listen
(
LoadingBackendTranslations
::
class
,
function
(
LoadingBackendTranslations
$event
)
{
$event
->
load
(
'users'
,
array_dot
(
trans
(
'user::users'
)));
$event
->
load
(
'roles'
,
array_dot
(
trans
(
'user::roles'
)));
});
$this
->
commands
([
GrantModulePermissionsCommand
::
class
,
RemoveModulePermissionsCommand
::
class
,
...
...
Modules/Workshop/Providers/WorkshopServiceProvider.php
View file @
5a48554d
...
...
@@ -4,6 +4,7 @@ namespace Modules\Workshop\Providers;
use
Illuminate\Support\ServiceProvider
;
use
Modules\Core\Events\BuildingSidebar
;
use
Modules\Core\Events\LoadingBackendTranslations
;
use
Modules\Core\Services\Composer
;
use
Modules\Core\Traits\CanGetSidebarClassForModule
;
use
Modules\Core\Traits\CanPublishConfiguration
;
...
...
@@ -45,6 +46,12 @@ class WorkshopServiceProvider extends ServiceProvider
BuildingSidebar
::
class
,
$this
->
getSidebarClassForModule
(
'workshop'
,
RegisterWorkshopSidebar
::
class
)
);
$this
->
app
[
'events'
]
->
listen
(
LoadingBackendTranslations
::
class
,
function
(
LoadingBackendTranslations
$event
)
{
$event
->
load
(
'workshop'
,
array_dot
(
trans
(
'workshop::workshop'
)));
$event
->
load
(
'modules'
,
array_dot
(
trans
(
'workshop::modules'
)));
$event
->
load
(
'themes'
,
array_dot
(
trans
(
'workshop::themes'
)));
});
}
public
function
boot
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment