You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the offical doc shows something like ->label('Settings') but I am doing ->label(__('admin.settings')) because my app's user menu should be translatable.
But when the user switches the language to Spanish, it still shows "Settings" (custom user menu items are the only things in my application that are not translated to Spanish, it is still in English language). The Filament native built-in "Logout" user menu item is translated correctly, it's only my CUSTOM menu items that are not being translated at all.
Additional information: I've found a workaround to make it work using closure.
->label(fn (): string => __('admin.settings'))
But I expect it to work using just ->label(__('admin.settings')) without the workaround.
Example Application
No response
Version of spatie/laravel-permission package:
6.7.0
Version of laravel/framework package:
v10.48.12
PHP version:
8.2.18
Database engine and version:
No response
OS: Windows/Mac/Linux version:
No response
The text was updated successfully, but these errors were encountered:
Description
Custom user menu item is not being translated, it is always shown in the app's main language, no matter the user switches to another language.
Steps To Reproduce
I am using filament/spatie-laravel-translatable-plugin.
Provider:
lang/en/admin.php:
lang/es/admin.php:
Note that the offical doc shows something like
->label('Settings')
but I am doing->label(__('admin.settings'))
because my app's user menu should be translatable.But when the user switches the language to Spanish, it still shows "Settings" (custom user menu items are the only things in my application that are not translated to Spanish, it is still in English language). The Filament native built-in "Logout" user menu item is translated correctly, it's only my CUSTOM menu items that are not being translated at all.
Additional information: I've found a workaround to make it work using closure.
But I expect it to work using just
->label(__('admin.settings'))
without the workaround.Example Application
No response
Version of spatie/laravel-permission package:
6.7.0
Version of laravel/framework package:
v10.48.12
PHP version:
8.2.18
Database engine and version:
No response
OS: Windows/Mac/Linux version:
No response
The text was updated successfully, but these errors were encountered: