Skip to content

Commit

Permalink
fix scan command if key has array as a value
Browse files Browse the repository at this point in the history
  • Loading branch information
3x1io committed Oct 28, 2024
1 parent c5aa867 commit 25ed116
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Services/SaveScan.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ protected function createOrUpdate($namespace, $group, $key, $mainKey = null): vo
$locals = config('filament-translations.locals');
$text = [];
foreach ($locals as $locale => $lang) {
$text[$locale] = Lang::get($mainKey, [], $locale, $mainKey);
$translation = Lang::get(key: $key, fallback: str($key)->replace('.', ' ')->replace('_', ' ')->title()->toString());
$text[$locale] = ! is_array($translation) ? Lang::get($key) : '';
}
$translation = Translation::query()->create([
'namespace' => $namespace,
Expand Down
Binary file modified tests/database/database.sqlite
Binary file not shown.

0 comments on commit 25ed116

Please sign in to comment.