F
Filament16mo ago
ghc

Translate other languages.

I need to translate "Navigation" and other pages into the language I'm using. From what I've seen in other tutorials, I only know how to activate language packs for specific countries. What I'm curious about is how to translate other pages and the navigation itself. I've tried adding files, but it hasn't been successful.
No description
16 Replies
ghc
ghcOP16mo ago
No description
Vp
Vp16mo ago
ghc
ghcOP16mo ago
I successfully switched the language for navigation. However, I'm not quite sure how to translate the titles and the text inside the tables (not the data) on those pages. I went through the Laravel documentation you provided and tried to follow it, but it doesn't seem to work. Or maybe I misunderstood something
ghc
ghcOP16mo ago
No description
No description
Vp
Vp16mo ago
For table/form label, you can use like this https://filamentphp.com/docs/3.x/tables/columns/getting-started#setting-a-label This code is very helpful ->label(__('message.abc')) for translation part, even you can change button label also
ghc
ghcOP16mo ago
i sucess the table part and button is there a way to change the titles? This is the last section
Vp
Vp16mo ago
wdym? what titles?
krekas
krekas16mo ago
There's a away to translate everything. Check the docs and methods using your ide
Dennis Koch
Dennis Koch16mo ago
You probably want to translate getModelLabel(), getModelPluralLabel(), getNavigationLabel() etc.
ghc
ghcOP15mo ago
This method works for Resources, but it is not effective for Custom pages
Dennis Koch
Dennis Koch15mo ago
They have their own properties and methods. Title and or Heading?
ghc
ghcOP15mo ago
I don't know if this belongs to Title or Heading.
No description
krekas
krekas15mo ago
Try both
ghc
ghcOP15mo ago
"In vendor\filament\filament\src\Resources\Pages\Page.php, I didn't see protected static ?string $modelLabel = null; like what's in vendor\filament\filament\src\Resources\Resource.php, so using protected static ?string $modelLabel in app\Filament\Resources\AttendanceResource\Pages\Attend.php doesn't have any effect. Should I define it in vendor\filament\filament\src\Resources\Pages\Page.php?"
krekas
krekas15mo ago
never edit vendor files
Dennis Koch
Dennis Koch15mo ago
If it's not there it doesn't exist. You are probably still looking for $title or $heading
Want results from more Discord servers?
Add your server