bugfixes
This commit is contained in:
parent
50c7e9562b
commit
aa83dd1436
@ -28,15 +28,32 @@ class LanguageService extends MediaService
|
|||||||
$appLangPath = storage_path('app/lang/default');
|
$appLangPath = storage_path('app/lang/default');
|
||||||
|
|
||||||
|
|
||||||
$groups = [
|
$groupNames = ['auth','button','common','dashboard','frontend','input','settings'];
|
||||||
'auth' => require storage_path('app/lang/groups/auth.php'),
|
|
||||||
'button' => require storage_path('app/lang/groups/button.php'),
|
$groups = [];
|
||||||
'common' => require storage_path('app/lang/groups/common.php'),
|
foreach ($groupNames as $groupName) {
|
||||||
'dashboard' => require storage_path('app/lang/groups/dashboard.php'),
|
$repoGroupPath1 = base_path("lang/{$data['code']}/groups/{$groupName}.php");
|
||||||
'frontend' => require storage_path('app/lang/groups/frontend.php'),
|
$repoGroupPath2 = base_path("lang/{$data['code']}/{$groupName}.php");
|
||||||
'input' => require storage_path('app/lang/groups/input.php'),
|
|
||||||
'settings' => require storage_path('app/lang/groups/settings.php'),
|
if (file_exists($repoGroupPath1)) {
|
||||||
|
$groups[$groupName] = require $repoGroupPath1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (file_exists($repoGroupPath2)) {
|
||||||
|
$file = require $repoGroupPath2;
|
||||||
|
$groups[$groupName] = [
|
||||||
|
[
|
||||||
|
'name' => ucfirst(str_replace('_', ' ', $groupName)),
|
||||||
|
'slug' => $groupName,
|
||||||
|
'properties' => $file,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$groups[$groupName] = require storage_path("app/lang/groups/{$groupName}.php");
|
||||||
|
}
|
||||||
|
|
||||||
$languages = Language::create($data);
|
$languages = Language::create($data);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user