Relation Managers Tab Translations

Hi there. Any idea how i can get those tab translated?
No description
11 Replies
Mohamed Ayaou
Mohamed Ayaou2mo ago
Just add ->label()
O.
O.2mo ago
I'm interested also!
Mohamed Ayaou
Mohamed Ayaou2mo ago
with __('key here')
O.
O.2mo ago
label for what?
Mohamed Ayaou
Mohamed Ayaou2mo ago
how did you defined them?
O.
O.2mo ago
// protected static ?string $title = __('tabs.trips'); this returns error because I use translation here, and it accepts strings only
Mohamed Ayaou
Mohamed Ayaou2mo ago
in which file are defining these tabs?
O.
O.2mo ago
this is a relation manager I got it .. 1- import use Illuminate\Database\Eloquent\Model; 2- protected static ?string $title = 'xxx'; 3- public static function getTitle(Model $ownerRecord, string $pageClass): string { return __('tabs.trips'); }
SnaggyDainc
SnaggyDaincOP2mo ago
for me $title (not $label) did the trick... thank you.
Mohamed Ayaou
Mohamed Ayaou2mo ago
try to override the public static function getTitle() function to use a translation
O.
O.2mo ago
I did, thanks a lot!

Did you find this page helpful?