Skip to content

Commit be7a05b

Browse files
authored
Merge pull request #49 from pxlrbt/feat/refactor-lang
use lang files
2 parents 0f51cdd + 3582a6e commit be7a05b

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

resources/lang/de/spotlight.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
return [
4+
'placeholder' => 'Nach :Record suchen',
5+
'account' => 'Dein Konto',
6+
];

resources/lang/en/spotlight.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
return [
4+
'placeholder' => 'Search for a :record',
5+
'account' => 'Your account',
6+
];

src/Actions/RegisterUserMenu.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public static function boot(Panel $panel)
3838
protected function getName(string $key, MenuItem $item): ?string
3939
{
4040
return match ($key) {
41-
'account' => $item->getLabel() ?? __('Your Account'),
42-
'logout' => $item->getLabel() ?? __('filament::layout.buttons.logout.label'),
41+
'account' => $item->getLabel() ?? __('filament-spotlight::spotlight.account'),
42+
'logout' => $item->getLabel() ?? __('filament-panels::layout.actions.logout.label'),
4343
default => $item->getLabel()
4444
};
4545
}

src/Commands/ResourceCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ public function dependencies(): ?SpotlightCommandDependencies
8686
}
8787

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

src/SpotlightPlugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function boot(Panel $panel): void
3838
{
3939
Filament::serving(function () use ($panel) {
4040
config()->set('livewire-ui-spotlight.include_js', false);
41+
4142
if (Filament::hasTenancy()) {
4243
Event::listen(TenantSet::class, function () use ($panel) {
4344
self::registerNavigation($panel);

src/SpotlightServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ class SpotlightServiceProvider extends ServiceProvider
1111
{
1212
public function boot()
1313
{
14+
$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'filament-spotlight');
15+
1416
config()->set('livewire-ui-spotlight.commands', []);
1517

1618
FilamentAsset::register([

0 commit comments

Comments
 (0)