Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Filament Translation Component

Filament Translation Component Laravel Package

tomatophp/filament-translation-component

Filament Translation Component for Laravel: a key/value translation field for Filament forms, designed to work with Spatie Translatable. Provides input and textarea variants, light/dark styling, and configurable language support for translatable attributes.

View on GitHub
Deep Wiki
Context7

Translation Component as a key/value to use it with Spatie Translatable FilamentPHP Plugin

Frequently asked questions about Filament Translation Component
How do I add a translatable field to a Filament form using this package?
Use the `Translation` component in your Filament form like this: `Translation::make('title')->label('Title')`. This creates a translatable field tied to Spatie Translatable’s backend. Ensure your model uses `HasTranslations` and the `translations` table exists.
Does this package support FilamentPHP v4.x or only v3.x?
This package is explicitly designed for FilamentPHP v3.x. While no breaking changes exist in v4.0.1, Filament v4.x compatibility isn’t guaranteed. Test thoroughly if upgrading. Check the changelog for future updates.
Can I customize which languages are available for translation?
Yes, configure supported languages in the package’s config file (`config/filament-translation-component.php`). This overrides the default languages and applies to all translation fields in your Filament resources.
Will this work with Laravel 10/11 and Spatie Translatable v3.0+?
Absolutely. The package is fully compatible with Laravel 10/11 and Spatie Translatable v3.0+. No additional setup is required beyond installing the package and ensuring your models use `HasTranslations`.
How do I switch between input and textarea variants for translations?
The package provides both variants by default. Use `Translation::make()->input()` for short text or omit it for textarea (default). Example: `Translation::make('description')->input()` forces an input field.
Is there a performance impact when using this package in production?
No significant performance overhead is introduced. Translations are stored as key/value pairs in Spatie’s `translations` table, and the package leverages Filament’s existing caching mechanisms. Test with your dataset to confirm.
Can I use this for nested or complex translations (e.g., JSON structures)?
This package is designed for simple key/value translations via Spatie Translatable. For nested or JSON-based translations, consider alternatives like `spatie/laravel-translation-loader` or custom solutions. The package lacks built-in support for these use cases.
How do I handle fallback locales (e.g., default to English if Spanish is missing)?
Fallback locales are handled automatically by Spatie Translatable. Configure fallbacks in your model’s `getTranslationFallbacks()` method or use Spatie’s default fallback logic. The package doesn’t override this behavior.
What if I encounter issues with form state updates after installing this package?
The package fixed a state update bug in v4.0.1. If issues persist, verify your Filament resource’s form submission logic and ensure you’re using the latest version. Test with a minimal resource to isolate the problem.
Are there alternatives if I need more advanced translation features (e.g., dynamic content)?
For dynamic or content-heavy translations, consider Laravel Nova’s built-in translations or `spatie/laravel-translation-loader` for JSON-based storage. This package is optimized for Filament’s UI-localization needs, not large-scale content management.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity