translate relation manager tabs

Hi, I want to translate the tabs within a relation manager, how can I achieve that? thanks!!
No description
Solution:
It should be like this ```php public static function getTitle(Model $ownerRecord, string $pageClass): string { return __('abc');...
Jump to solution
8 Replies
Vp
Vp16mo ago
public static function getTitle(): string
{
return __('message.abc');
}
public static function getTitle(): string
{
return __('message.abc');
}
ingmontoya
ingmontoyaOP16mo ago
Tried that already but it gave me this error Method 'App\Filament\Resources\PatientResource\RelationManagers\TreatmentsRelationManager::getTitle()' is not compatible with method 'Filament\Resources\RelationManagers\RelationManager::getTitle()'.
Solution
Vp
Vp16mo ago
It should be like this
public static function getTitle(Model $ownerRecord, string $pageClass): string
{
return __('abc');
}
public static function getTitle(Model $ownerRecord, string $pageClass): string
{
return __('abc');
}
Vp
Vp16mo ago
You are using in v3 right?
ingmontoya
ingmontoyaOP16mo ago
Correct Nice, that worked. Thanks mate!
Gush
Gush15mo ago
i need help in this
protected static ?string $title = __('customer.customer_relation_manager.Owner');

public static function getTitle(Model $ownerRecord, string $pageClass): string
{
return __('customer.customer_relation_manager.Owner');
}
protected static ?string $title = __('customer.customer_relation_manager.Owner');

public static function getTitle(Model $ownerRecord, string $pageClass): string
{
return __('customer.customer_relation_manager.Owner');
}
protected static ?string $title = '';


public function __construct()
{
static::$title = __('equipment.equipment_resource.name');
}
protected static ?string $title = '';


public function __construct()
{
static::$title = __('equipment.equipment_resource.name');
}
solution not quite the solution, it bugs sometimes
Vp
Vp15mo ago
Put only this (below code) and remove $title and __construct
public static function getTitle(Model $ownerRecord, string $pageClass): string
{
return __('customer.customer_relation_manager.Owner');
}
public static function getTitle(Model $ownerRecord, string $pageClass): string
{
return __('customer.customer_relation_manager.Owner');
}
Gush
Gush15mo ago
yeah worked, i forgot to
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Model;
when trying the solution in this post thank you

Did you find this page helpful?