- What does afsakar/filament-translate-action do?
- It adds a ready-made Filament form action that translates translatable model fields between locales using a configurable translation driver, directly inside the admin panel. The package is a thin wrapper around a machine-translation provider and mutates form state only. Persistence, validation, and business rules stay in your host Laravel application.
- How do I install filament-translate-action in a Laravel app?
- Install it with composer require afsakar/filament-translate-action, publish the config file, and set your source and target locales. Then attach the action to each translatable field, for example with suffixAction(TranslateAction::make('translate')). A working demo is typically half a day of work for a competent Laravel developer.
- Which Filament versions does this package support?
- The v1.2.x line targets Filament v3 and v4. Mixing Filament majors can produce confusing Livewire mount errors rather than a clean Composer conflict. Pin your Filament constraint deliberately and verify the installed package constraint matches your admin panel version.
- Does it work with spatie/laravel-translatable?
- Yes. The action is designed for Filament forms with translatable fields, including spatie/laravel-translatable or per-locale columns. It only changes form state values, so your existing resource save logic and validation still handle persistence. If your admin is Inertia/Vue, Nova, or a bespoke SPA, this package does not apply.
- Can the translate action handle fields inside repeaters or relation managers?
- It can, but state scoping is a real risk in repeaters, builders, and relation managers. A mis-resolved state path can silently translate the wrong field, so verify each resource shape before rollout. Keep a short per-resource checklist covering plain fields, repeaters, and nested relation managers.
- Which translation provider does it use and what does it cost?
- The package wraps a machine-translation API, and that provider is the main product risk because of quota, cost, rate limits, and data leaving your environment. Review cost per 1,000 characters and decide who owns the API key and its rotation. If you need DeepL or an internal MT service, check whether a provider interface can be bound so swapping is configuration rather than a rewrite.
- Does the translate action overwrite existing translated content?
- Teams should decide explicitly whether the action writes only into empty target fields or overwrites existing values. Overwriting a human-reviewed string is a workflow and accountability risk. Add a review step for machine output rather than trusting the button blindly, and document who is responsible for overwrites.
- Is filament-translate-action safe for production use?
- For a small internal convenience it is fine, but it has a single maintainer, modest adoption, and a last release in October 2024. It is not ideal as a load-bearing dependency in regulated or long-horizon products without an internal fork plan. Also plan for provider compliance review, validation re-runs after translation, and mitigating Livewire stalls from long text fields.
- What are alternatives to filament-translate-action?
- You can build a custom Filament action around your own translation provider, pair spatie/laravel-translatable with a translation service, or integrate DeepL or Google directly. This package only fits Laravel plus Filament admin panels with translatable content. It is not applicable to Nova, Inertia/Vue, or custom SPAs.
- How do I test and maintain this package long-term?
- Pin the package version and Filament major, then test each resource shape and locale mapping, including cases like pt vs pt-BR and zh-CN vs zh-TW. Machine output in the wrong locale can look plausible and survive human review, so add a verification step. Have a fork-and-maintain plan if upstream goes quiet, and remember removal is a Composer remove plus deleting the attached actions.