Skip to content

Commit

Permalink
use lang files
Browse files Browse the repository at this point in the history
  • Loading branch information
pxlrbt committed Nov 18, 2024
1 parent 5d63194 commit 3582a6e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
6 changes: 6 additions & 0 deletions resources/lang/de/spotlight.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'placeholder' => 'Nach :Record suchen',
'account' => 'Dein Konto',
];
6 changes: 6 additions & 0 deletions resources/lang/en/spotlight.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

return [
'placeholder' => 'Search for a :record',
'account' => 'Your account',
];
4 changes: 2 additions & 2 deletions src/Actions/RegisterUserMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public static function boot(Panel $panel)
protected function getName(string $key, MenuItem $item): ?string
{
return match ($key) {
'account' => $item->getLabel() ?? __('Your Account'),
'logout' => $item->getLabel() ?? __('filament::layout.buttons.logout.label'),
'account' => $item->getLabel() ?? __('filament-spotlight::spotlight.account'),
'logout' => $item->getLabel() ?? __('filament-panels::layout.actions.logout.label'),
default => $item->getLabel()
};
}
Expand Down
4 changes: 3 additions & 1 deletion src/Commands/ResourceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ public function dependencies(): ?SpotlightCommandDependencies
}

return SpotlightCommandDependencies::collection()->add(
SpotlightCommandDependency::make('record')->setPlaceholder(__('Search for a :record', ['record' => $this->resource::getModelLabel()]))
SpotlightCommandDependency::make('record')->setPlaceholder(
__('filament-spotlight::spotlight.placeholder', ['record' => $this->resource::getModelLabel()])
)
);
}

Expand Down
1 change: 1 addition & 0 deletions src/SpotlightPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function boot(Panel $panel): void
{
Filament::serving(function () use ($panel) {
config()->set('livewire-ui-spotlight.include_js', false);

if (Filament::hasTenancy()) {
Event::listen(TenantSet::class, function () use ($panel) {
self::registerNavigation($panel);
Expand Down
2 changes: 2 additions & 0 deletions src/SpotlightServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ class SpotlightServiceProvider extends ServiceProvider
{
public function boot()
{
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'filament-spotlight');

config()->set('livewire-ui-spotlight.commands', []);

FilamentAsset::register([
Expand Down

0 comments on commit 3582a6e

Please sign in to comment.