Relation Managers Tab Translations

Hi there. Any idea how i can get those tab translated?
No description
11 Replies
Mohamed Ayaou
Mohamed Ayaou3w ago
Just add ->label()
O.
O.3w ago
I'm interested also!
Mohamed Ayaou
Mohamed Ayaou3w ago
with __('key here')
O.
O.3w ago
label for what?
Mohamed Ayaou
Mohamed Ayaou3w ago
how did you defined them?
O.
O.3w ago
// protected static ?string $title = __('tabs.trips'); this returns error because I use translation here, and it accepts strings only
Mohamed Ayaou
Mohamed Ayaou3w ago
in which file are defining these tabs?
O.
O.3w 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
SnaggyDaincOP3w ago
for me $title (not $label) did the trick... thank you.
Mohamed Ayaou
Mohamed Ayaou3w ago
try to override the public static function getTitle() function to use a translation
O.
O.3w ago
I did, thanks a lot!

Did you find this page helpful?