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
Vp15mo ago
public static function getTitle(): string
{
return __('message.abc');
}
public static function getTitle(): string
{
return __('message.abc');
}
ingmontoya
ingmontoyaOP15mo 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
Vp15mo 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
Vp15mo ago
You are using in v3 right?
ingmontoya
ingmontoyaOP15mo ago
Correct Nice, that worked. Thanks mate!
Gush
Gush14mo 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
Vp14mo 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
Gush14mo 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
Want results from more Discord servers?
Add your server