-
Notifications
You must be signed in to change notification settings - Fork 4
Working with Multiple Language Guide
Elevate the accessibility and user-friendliness of this Starter Project by embracing multiple languages. With the assistance of Filament Translations and the Laravel Lang package, this Starter Project offers comprehensive multilingual support.
As of now, this Starter Project provides support for two languages: Bangla and English. However, the flexibility is built in for you to add more languages based on your project's requirements.
To expand your project's language support, follow these steps:
-
Visit the Filament Translations Documentation:
Start by visiting the Filament Translations documentation to understand how to manage translations efficiently.
-
Leverage Laravel Lang:
The Laravel Lang package provides a wealth of language files for different languages. You can access and integrate these language files into your project.
-
Custom Translations:
If you require custom translations for specific project-related content, you can create your own translation files and integrate them with your project.
you can add a new language by following this command
php artisan lang:add es
Inside your language folder you can add your custom translations for example check this bangla translation code
<?php
declare(strict_types=1);
return [
'role' => 'রোল',
'role.plural' => 'রোলগুলো',
'permission' => 'পার্মিশন',
'permission.plural' => 'পার্মিশনগুলো',
'user' => 'ব্যবহারকারী',
'user.plural' => 'ব্যবহারকারীরা',
];
You can set the Model label and plural Label in a resource and rest of the translation will be done by Filament translations
public static function getModelLabel(): string
{
return __('resources.user');
}
public static function getPluralLabel(): ?string
{
return __('resources.user.plural');
}