mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-08 10:39:27 +01:00
load translations earlier
This commit is contained in:
parent
10dd7b7b47
commit
b0e5c7cc4a
@ -55,6 +55,14 @@ class PluginService
|
||||
config()->set($plugin->id, require $config);
|
||||
}
|
||||
|
||||
// Load translations
|
||||
$translations = plugin_path($plugin->id, 'lang');
|
||||
if (file_exists($translations)) {
|
||||
$this->app->afterResolving('translator', function ($translator) use ($plugin, $translations) {
|
||||
$translator->addNamespace($plugin->id, $translations);
|
||||
});
|
||||
}
|
||||
|
||||
// Autoload src directory
|
||||
if (!array_key_exists($plugin->namespace, $classLoader->getClassMap())) {
|
||||
$classLoader->setPsr4($plugin->namespace . '\\', plugin_path($plugin->id, 'src/'));
|
||||
@ -88,14 +96,6 @@ class PluginService
|
||||
});
|
||||
}
|
||||
|
||||
// Load translations
|
||||
$translations = plugin_path($plugin->id, 'lang');
|
||||
if (file_exists($translations)) {
|
||||
$this->app->afterResolving('translator', function ($translator) use ($plugin, $translations) {
|
||||
$translator->addNamespace($plugin->id, $translations);
|
||||
});
|
||||
}
|
||||
|
||||
// Load views
|
||||
$views = plugin_path($plugin->id, 'resources', 'views');
|
||||
if (file_exists($views)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user