Skip to content

Commit

Permalink
Merge pull request #19 from IBEC-BOX/fix/configure-navigation-group
Browse files Browse the repository at this point in the history
fix: add configurable navigation_group
  • Loading branch information
ast21 authored Sep 17, 2024
2 parents 2f2ad7f + 0dde437 commit f20ac16
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
2 changes: 2 additions & 0 deletions config/admin-kit-localizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@
'path' => '{locale}.json',

'route_enabled' => true,

'navigation_group_enabled' => false,
];
1 change: 1 addition & 0 deletions resources/lang/en/localizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'resource' => [
'label' => 'Localization',
'plural_label' => 'Localizations',
'navigation_group' => 'Localizations',

'id' => 'ID',
'key' => 'Key',
Expand Down
1 change: 1 addition & 0 deletions resources/lang/ru/localizations.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
'resource' => [
'label' => 'Локализация',
'plural_label' => 'Локализации',
'navigation_group' => 'Локализации',

'id' => 'ID',
'key' => 'Ключ',
Expand Down
8 changes: 6 additions & 2 deletions src/UI/Filament/Resources/LocalizationResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ public static function getPluralLabel(): ?string
return __('admin-kit-localizations::localizations.resource.plural_label');
}

public static function getNavigationGroup(): string
public static function getNavigationGroup(): ?string
{
return __('admin-kit-localizations::localizations.resource.plural_label');
if (! config('admin-kit-localizations.navigation_group_enabled')) {
return null;
}

return __('admin-kit-localizations::localizations.resource.navigation_group');
}

public static function getRelations(): array
Expand Down

0 comments on commit f20ac16

Please sign in to comment.