Back to School: coupon SCHOOL25 for 40% off Yearly/Lifetime membership! Read more here

Multi-language with Switcher

Filament 4
Also available in Filament 3 version

Multi-language Filament implementation with three translation components: Core Filament files, Core Laravel files, and custom additions. Lithuanian language example included with translations in /lang folder and a Filament package for language switching.

NmX6Gegya5SPpVMBtG8yNuZd76jYXA-metaMTUtbXVsdGktbGFuZ3VhZ2Utc3dpdGNoZXIucG5n-

Get the Source Code:

How it works

We use a [bezhansalleh/filament-language-switch](https://filamentphp.com/plugins/bezhansalleh-language-switch) package to add a language switcher to the top navigation.

All language files are published.

php artisan lang:publish
php artisan vendor:publish --tag=filament-panels-translations

We set available languages in the AppServiceProvider.

app/Providers/AppServiceProvider.php:

use BezhanSalleh\LanguageSwitch\LanguageSwitch;
 
public function boot(): void
{
LanguageSwitch::configureUsing(function (LanguageSwitch $switch) {
$switch
->locales(['lt','en']);
});
}

In the Resource, we use the translateLabel() method to translate labels. It makes, for example, Title to a __('Title').

The FULL tutorial is available after the purchase: in the Readme file of the official repository you would get invited to.
Get the Source Code: All 151 Premium Examples for $99