Translate Resource Title
Is there a way to just translate the resource title without having to specify all titles for all pages?
10 Replies
Not really. You could extend all base pages and overwrite
getTitle()
on them and then extend your pages instead.hm okay, would be cool because I'm currently in the situation where I need to translate just the resource title. Filament already supports german but if my models are written in english it would be super nice to have just one configuration for the label and all views and delete modals would take it.
I think we had this in v1 and it was causing issues
can you quickly tell me where or how I can set the deletion modal text?
DeleteAction::make()->modalHeading()
Ah, thanks π
Maybe I got you wrong. What do you mean by "having to specify all titles for all pages"? If you set the
$modelLabel
and $modelPluralLabel
it should use that one for all pages.Ah, just found it in the docs. Yeah, totally meant that one, sorry for my bad wording.
Hi, how can i make the $modelLabel translatable?
This does NOT work:
Found it in Documentation, sorry:
'''public static function getModelLabel(): string
{
return __('filament/resources/customer.label');
}''''
No worries, I fell into the same trap some days ago π