filament-translations
Manage your translation with DB and cache
يمتدّ من filament
composer require tomatophp/filament-translations- filamentphp
- plugin
- tomatophp
- translation
- translation-manager
إضافات تبني عليها (3)
- filament-translations-gpt
Translations Manager extension to use ChatGPT openAI to auto translate your __(), trans() fn
- filament-translations-google
Translations Manager extension to use Google translation crawling to auto translate your __(), trans() fn
- filament-translations-demo
Filament Translation Manager Demo
اقرأني

Filament Translations Manager
Manage your translation with DB and cache, you can scan your languages tags like trans(), __(), and get the string inside and translate them use UI.
this plugin is build in spatie/laravel-translation-loader
Version Compatibility
| Plugin | Filament | Laravel | PHP |
|---|---|---|---|
| 1.x / 2.x | 3.x | 10.x / 11.x | 8.1+ |
4.x (v4 branch) | 4.x | 11.x / 12.x | 8.2+ |
| 5.x | 5.x | 12.x / 13.x | 8.2+ |
Screenshots

Installation
now run install command, it runs the migrations and imports the translations of your app
Finally register the plugin on /app/Providers/Filament/AdminPanelProvider.php
Extensions
Allow Create Button to Create New Language
If you want to allow the user to create a new language, you need to add the following to your panel provider:
Allow Clear All Translations Button
If you want to allow the user to clear all translations, you need to add the following to your panel provider:
Authorization
The translation model lives in this package, so Laravel cannot auto-discover a policy for it. Set the policy in the config file:
When policy is null and your app has App\Policies\TranslationPolicy (for example one generated by Filament Shield), it is registered for you.
The resource pages follow the policy (viewAny, create, update, delete, deleteAny), the scan and import actions require create and the clear action requires deleteAny.
Without a policy everything stays available, as before.
Laravel Octane
The plugin boots on every request. Actions, columns, filters and form fields registered through the hooks below are keyed by name, so registering them again on the next request replaces them instead of adding duplicates.
Use Language Switcher
we move language switcher to another package you can check it Filament Language Switcher
Scan Using Command Line
You can scan your project to get all the languages tags and save them to the database
The scanner finds __(), trans(), trans_choice(), @lang(), @choice() and Lang::get() calls, with or without parameters (__('Hello :name', ['name' => $name])).
Group keys such as __('messages.welcome') are stored once, under their group, with the text from your language files.
To write the JSON strings of a folder (for example a package) to its resources/lang/en.json:
Change Scan to work on Queue
In your config file just change the use_queue_on_scan to true
Custom Import Command
You can create your own command to import the translations, add your custom import class to the config file like this:
This command will automatically run when you click on the "Scan For New Languages" button in the UI.
Custom Excel Import
You can create your own Excel import to import the translations, add your custom import class to the config file like this:
The import class is based on the Laravel Excel package. You can check the documentation here. This import will automatically run when you click on the "Import" button in the UI.
The default import reads the file produced by the export (id, key, then one column per locale). Empty cells keep the stored text.
Custom Excel Export
You can create your own Excel export to export the translations in your own format, add your custom export class to the config file like this:
The export class is based on the Laravel Excel package. You can check the documentation here. This export will automatically run when you click on the "Export" button in the UI.
Show or hide buttons in the UI
You can show or hide the buttons in the UI by changing the config file. By default, all buttons are shown.
Custom Resource Nav Label & Group
you can custom your resource nav from config file
Custom Resource
You can create your own resource to show the translations in the UI, add your custom resource class to the config file like this:
This is especially useful when you want to have complete control over the UI but still want to use the translations package. Think about implementing a check on user roles when using shouldRegisterNavigation in your custom resource.
Translation Translations Resource Hooks
we have add a lot of hooks to make it easy to attach actions, columns, filters, etc
Table Columns
Table Actions
Table Filters
Table Bulk Actions
Table Header Actions
Form Components
Page Actions
Publish Assets
You can publish config file by use this command:
You can publish views file by use this command:
You can publish languages file by use this command:
You can publish migrations file by use this command:
Testing
if you like to run PEST testing just use this command
Code Style
if you like to fix the code style just use this command
PHPStan
if you like to check the code by PHPStan just use this command
Other Filament Packages
Checkout our Awesome TomatoPHP