F
Filamentβ€’5mo ago
BlackShadow

Translations sub-navigation pages

I chose to use sub-navigation menus, but I'm struggling to translate the model label. It worked fine in a regular relationship manager, but here it only shows as "Question answer" or "Question answers."
No description
Solution:
Seems like ->modelLabel('Your label here') works. β˜‘οΈ
Jump to solution
12 Replies
Sjoerd24
Sjoerd24β€’5mo ago
With ->emptyStateHeading(__('No question answers')) you can fix sth like that on the table dank voor je super plugin trouwens, mega praktisch in mijn project.. πŸ˜‰
BlackShadow
BlackShadowβ€’5mo ago
This would work but it would be perfect if i could use "translate" the model label part. (Which is possible on relation manager) πŸ’™
Solution
BlackShadow
BlackShadowβ€’5mo ago
Seems like ->modelLabel('Your label here') works. β˜‘οΈ
Sjoerd24
Sjoerd24β€’5mo ago
Ah die kende ik ook nog niet! Betere oplossing idd.
Vp
Vpβ€’5mo ago
@CodeWithDennis sorry for tagging, but where did you put ->modelLabel() for translation
BlackShadow
BlackShadowβ€’5mo ago
On the table. There is also a plural method.
Vp
Vpβ€’5mo ago
Oh this question is about table empty state right?
BlackShadow
BlackShadowβ€’5mo ago
Also the button
Vp
Vpβ€’5mo ago
I want this part
No description
Vp
Vpβ€’5mo ago
for translation
BlackShadow
BlackShadowβ€’5mo ago
public static function getNavigationLabel(): string
public static function getNavigationLabel(): string
in view file
Vp
Vpβ€’5mo ago
Working fine.. thanks