F
Filament10mo ago
WEBMAS

How to make multilingual?

Hello everyone. I want to make a choice of interface language. What are the best plugins for this? Is there a guide? How to create fields in a database for different languages. What's the best practice?
11 Replies
Blackpig
Blackpig10mo ago
There's the Filament package for Spatie Translatable https://filamentphp.com/plugins/filament-spatie-translatable
Filament
Spatie Translatable by Filament - Filament
Filament support for Spatie's Laravel Translatable package.
WEBMAS
WEBMASOP10mo ago
Filament
Language Switch by Bezhan Salleh - Filament
Zero config Language Switcher plugin for Filament Panels.
dissto
dissto10mo ago
In your case you want both plugins 😂 Spatie Translatable to translate your content and the switch for your users to change the language (of the UI) with ease. Note that the first plugin is for translating content as opposed to the UI. For that you can just use the regular localization feature.
WEBMAS
WEBMASOP10mo ago
I will need this setting https://laravel.com/docs/10.x/localization from Laravel. On the Filament side, what setting or plugin is needed? Tasks: 1. Localization of the admin panel interface (UI) 2. Localization of some post fields, for example Title 3. Switch language What plugins and settings will be needed for this? Can you create a consistent guide? Thank you.
awcodes
awcodes10mo ago
dissto is correct it’s two different plugins controlling two different things. The Filament plugin allows you to change the language for form input / storage. Bezhan’s plugin changes the app locale at the Laravel level.
WEBMAS
WEBMASOP10mo ago
So what should I do to complete the tasks? Which case should I use?
awcodes
awcodes10mo ago
Depends on your app needs. You can certainly use them both at the same time.
WEBMAS
WEBMASOP10mo ago
Here is the basic need for localization: - Localization of the admin panel interface (UI) - Localization of some post table form fields, for example "Title" (en Title, es Title and etc) - Switch language
awcodes
awcodes10mo ago
Yea. So use both.
WEBMAS
WEBMASOP10mo ago
Will the language packs be common between the two plugins? Is it best practice to use these two plugins or are there better solutions?
awcodes
awcodes10mo ago
What language packs? The languages are handled by your app at the Laravel level. There is no best or worst practice. Nor have I seen a plugin that does both. Just try them out. See if they work for you. Create a new branch for your app, install them, see if they work for you. If they don’t just delete the branch and try to find another solution.
Want results from more Discord servers?
Add your server