PHPackages                             filamerce/filament-translatable - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. filamerce/filament-translatable

Abandoned → [webard/filament-translatable](/?search=webard%2Ffilament-translatable)ArchivedLibrary[Localization &amp; i18n](/categories/localization)

filamerce/filament-translatable
===============================

Highly customizable Translation component for FilamentPHP.

v3.2.0(4mo ago)21.2k↑25%[1 issues](https://github.com/filamerce/filament-translatable/issues)MITPHPPHP ^8.2CI passing

Since Aug 12Pushed 3mo agoCompare

[ Source](https://github.com/filamerce/filament-translatable)[ Packagist](https://packagist.org/packages/filamerce/filament-translatable)[ Docs](https://github.com/filamerce/filament-translatable)[ RSS](/packages/filamerce-filament-translatable/feed)WikiDiscussions v3 Synced 1mo ago

READMEChangelog (7)Dependencies (8)Versions (9)Used By (0)

Filament Translatable
=====================

[](#filament-translatable)

The package was moved here:
-----------------------------------------------------------------------------

[](#the-package-was-moved-here-httpsgithubcomwebardfilament-translatable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a69f025de5149371df5a1d91e8d019b904b320483b58c39025b222ea81c6c208/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66696c616d657263652f66696c616d656e742d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/filamerce/filament-translatable)[![Total Downloads](https://camo.githubusercontent.com/24b2bca7b9136da87d2f8ce95eb9291e2147875c6794b11b6b04833aeffc5f2f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66696c616d657263652f66696c616d656e742d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/filamerce/filament-translatable)

Filament Translatable is a set of tools that help manage translations.

[![translatable component](https://raw.githubusercontent.com/filamerce/filament-translatable/refs/heads/v3/screenshots/component.png)](https://raw.githubusercontent.com/filamerce/filament-translatable/refs/heads/v3/screenshots/component.png)

Installation
------------

[](#installation)

Filament VersionFilament Translate Field Version3.x2.x4.x3.x5.x3.xYou can install the package via composer:

```
composer require filamerce/filament-translatable
```

Publish the assets:

```
php artisan filament:assets
```

Configuration
-------------

[](#configuration)

With `spatie/laravel-translatable`
----------------------------------

[](#with-spatielaravel-translatable)

The package from [Spatie](https://github.com/spatie/laravel-translatable) is the default supported way of handling translations. Follow the instructions in the [README](https://github.com/spatie/laravel-translatable/?tab=readme-ov-file#a-trait-to-make-eloquent-models-translatable) to properly configure your models.

With `astrotomic/laravel-translatable`
--------------------------------------

[](#with-astrotomiclaravel-translatable)

The package from [Astrotomic](https://github.com/astrotomic/laravel-translatable) is an alternative supported way of handling translations.

Follow the [instructions](https://docs.astrotomic.info/laravel-translatable/installation#models) to properly configure your models, but instead of using the `Translatable` trait from the Astrotomic package, please use `Filamerce\FilamentTranslatable\Traits\AstrotomicTranslatable`.

If you use the Astrotomic package, please configure the plugin to work in Astrotomic mode:

```
use Filamerce\FilamentTranslatable\Enums\TranslationMode;

FilamentTranslatablePlugin::make()
    ->translationMode(TranslationMode::Astrotomic)
```

You can also configure `translationMode` per component:

```
 Translations::make('translations')
    ->translationMode(TranslationMode::Astrotomic)
```

Or per field:

```
 TextInput::make('name')
    ->translatable()
    ->translationMode(TranslationMode::Astrotomic)
```

Setup
-----

[](#setup)

```
use Filamerce\FilamentTranslatable\FilamentTranslatablePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->plugin(FilamentTranslatablePlugin::make());
}
```

### Setting translatable locales

[](#setting-translatable-locales)

To set up the locales that can be used to translate content, pass an array of locales to the `locales()` plugin method:

```
FilamentTranslatablePlugin::make()
     ->locales(['en', 'pl', 'fr']),
```

You can set locale labels using key =&gt; value array:

```
FilamentTranslatablePlugin::make()
    ->locales([
        'pl' => __('Polish'),
        'en' => __('English')
    ])
```

Also, you can pass a Closure:

```
FilamentTranslatablePlugin::make()
    ->locales(fn () => Language::pluck('code', 'name'))
```

### Setting default locale

[](#setting-default-locale)

You can set the default locale using the `defaultLocale()` method:

```
FilamentTranslatablePlugin::make()
     ->defaultLocale('pl'),
```

### Enable or disable flags in locale labels

[](#enable-or-disable-flags-in-locale-labels)

You can enable or disable flags in locale labels (disabled by default):

```
FilamentTranslatablePlugin::make()
    ->displayFlagsInLocaleLabels(true)
```

### Setting flag width

[](#setting-flag-width)

You can set the flag width using:

```
FilamentTranslatablePlugin::make()
    ->flagWidth('24px')
```

### Enable or disable names in locale labels

[](#enable-or-disable-names-in-locale-labels)

You can enable or disable locale names in locale labels (enabled by default):

```
FilamentTranslatablePlugin::make()
    ->displayNamesInLocaleLabels(false)
```

Otherwise, the config value `app.locale` will be used.

This affects several methods that can be used on fields.

Usage
-----

[](#usage)

### `translatable()` macro

[](#translatable-macro)

By using the `translatable()` macro, you can quickly configure a single [form field](https://filamentphp.com/docs/4.x/forms/fields/getting-started) to support multiple languages and provide translations for each locale.

```
use Filament\Forms\Components\TextInput;

TextInput::make('name')
    ->translatable()
```

[![translatable macro](https://raw.githubusercontent.com/filamerce/filament-translatable/refs/heads/v3/screenshots/macro.png)](https://raw.githubusercontent.com/filamerce/filament-translatable/refs/heads/v3/screenshots/macro.png)

#### Marking field as required for specified locale

[](#marking-field-as-required-for-specified-locale)

This way, the "name" field will only be required in the "en" language.

```
use Filament\Forms\Components\TextInput;

TextInput::make('name')
    ->requiredLocale('en')
    ->translatable()
```

#### Marking field as required for default locale

[](#marking-field-as-required-for-default-locale)

This way, the "name" field will only be required in the default language.

```
use Filament\Forms\Components\TextInput;

TextInput::make('name')
    ->requiredDefaultLocale()
    ->translatable()
```

#### Decorating language specified fields

[](#decorating-language-specified-fields)

You can fully customize language-specific fields using the `decorateTranslationField()` method.

```
use Filament\Forms\Components\TextInput;

TextInput::make('price')
    ->decorateTranslationField('pl', fn (TextInput $field) => $field->suffix('PLN'))
    ->decorateTranslationField('en', fn (TextInput $field) => $field->prefix('USD')),
    ->translatable()
```

#### Customizing `Translations` component

[](#customizing-translations-component)

After using the `translatable()` method, the context of the field is switched to the `Translations` component, so you can use any method that belongs to the component.

```
use Filament\Forms\Components\TextInput;

TextInput::make('price')
    ->requiredDefaultLocale()
    ->translatable() // Here context is switched from TextInput to Translations component
    ->vertical()
    ->displayFlagsInLocaleLabels(true)
    ->displayNamesInLocaleLabels(false)
    ->flagWidth('48px')
```

[![translatable custom macro](https://raw.githubusercontent.com/filamerce/filament-translatable/refs/heads/v3/screenshots/macro2.png)](https://raw.githubusercontent.com/filamerce/filament-translatable/refs/heads/v3/screenshots/macro2.png)

Caution

Be sure to set field-specific methods like `required()` or `requiredDefaultLocale()` **before** calling the `translatable()` method.

### `Translations` component

[](#translations-component)

By using the `Translations` component, you can easily configure your [form fields](https://filamentphp.com/docs/4.x/forms/fields/getting-started) to support multiple languages and provide translations for each locale.

```
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make('translations') // name is required to properly handle actions
    ->schema([
        TextInput::make('name')
    ])
```

[![translatable horizontal component](https://raw.githubusercontent.com/filamerce/filament-translatable/refs/heads/v3/screenshots/horizontal-component.png)](https://raw.githubusercontent.com/filamerce/filament-translatable/refs/heads/v3/screenshots/horizontal-component.png)

Note

Using the `translatable()` method within the `Translations` component is not needed.

Important

Be sure to set different names for each `Translations` component when using multiple instances.

#### Setting the translatable locales for a particular fields

[](#setting-the-translatable-locales-for-a-particular-fields)

By default, the translatable locales can be set globally for all translation form components in the plugin configuration. Alternatively, you can customize the translatable locales for a particular resource by overriding the `locales()` method in the `Translate` class:

```
Translations::make('translations')
    ->locales(['en', 'es'])
```

#### Setting the translatable label for a particular field

[](#setting-the-translatable-label-for-a-particular-field)

You have the flexibility to customize the translation label for each field in each locale. You can use the `fieldTranslatableLabel()` method to provide custom labels based on the field instance and the current locale.

```
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

 Translations::make()
    ->schema([
        // Fields
    ])
    ->fieldTranslatableLabel(fn ($field, $locale) => __($field->getName(), locale: $locale))
```

#### Adding prefix/suffix locale label to the field

[](#adding-prefixsuffix-locale-label-to-the-field)

If you want to add a prefix or suffix locale label to the form field, you can use the `prefixLocaleLabel()` or `suffixLocaleLabel()` method. This makes it easier for users to identify the language associated with each field.

```
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make('translations')
    ->schema([
        // Fields
    ])
    ->prefixLocaleLabel()
    ->suffixLocaleLabel()
```

#### Setting the locale display name

[](#setting-the-locale-display-name)

By default, the prefix/suffix locale display name is generated from the locale code and enclosed in parentheses, "()". You may customize this using the `preformLocaleLabelUsing()` method:

```
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make('translations')
    ->preformLocaleLabelUsing(fn (string $locale, string $label) => "[{$label}]");
```

#### Injecting the current form field

[](#injecting-the-current-form-field)

Additionally, if you need to access the current form field instance, you can inject the `$field` parameter into the callback functions. This allows you to perform specific actions or apply conditions based on the field being processed.

```
use Filament\Forms\Components\Component;
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make('translations')
    // ...
    ->prefixLocaleLabel(function(Component $field) {
        // need return boolean value
        return $field->getName() == 'title';
    })
    ->suffixLocaleLabel(function(Component $field) {
        // need return boolean value
        return $field->getName() == 'title';
    })
```

#### Adding action

[](#adding-action)

You may add actions before each container of child components using the `actions()` method:

```
use Filament\Forms\Components\Actions\Action;
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make('translations')
    ->actions([
        Action::make('fillDumpTitle')
    ])
```

#### Injecting the locale on current child container

[](#injecting-the-locale-on-current-child-container)

If you wish to access the locale that has been passed to the action, define an `$arguments` parameter and get the value of `locale` from `$arguments`:

```
use Filament\Forms\Components\Actions\Action;
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make()
    ->actions([
        Action::make('fillDumpTitle')
            ->action(function (array $arguments) {
                $locale = $arguments['locale'];
                // ...
            })
    ])
```

#### Injecting the locale to form field

[](#injecting-the-locale-to-form-field)

If you wish to access the current locale instance for the field, define a `$locale` parameter:

```
use Filament\Forms\Components\TextInput;
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make()
    ->schema(fn (string $locale) => [TextInput::make('title')->required($locale == 'en')])
```

#### Removing the styled container

[](#removing-the-styled-container)

By default, the translate component and its content are wrapped in a container styled as a card. You may remove the styled container using `contained()`:

```
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make()
    ->contained(false)
```

#### Vertical tabs

[](#vertical-tabs)

You can display translations as vertical tabs:

```
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make()
    ->vertical()
```

#### Changing plugin settings

[](#changing-plugin-settings)

You can customize plugin settings directly on the component:

```
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make()
    ->displayNamesInLocaleLabels(false)
    ->displayFlagsInLocaleLabels(true)
    ->flagWidth('48px')
```

#### Exclude

[](#exclude)

The `exclude` feature allows you to specify fields that you don't want to include in the translation process. This can be useful for fields that contain dynamic content or that shouldn't be translated into other languages.

```
use Filamerce\FilamentTranslatable\Forms\Component\Translations;

Translations::make('translations')
    ->schema([
        Forms\Components\TextInput::make('title'),
        Forms\Components\TextInput::make('description'),
    ])
    ->exclude(['description'])
```

Without `exclude`:

```
{
    "title": {
        "en": "Dump",
        "es": "Dump",
        "fr": "Dump"
    },
    "description": {
        "en": null,
        "es": null,
        "fr": null
    }
}
```

With `exclude`:

```
{
    "title": {
        "en": "Dump",
        "es": "Dump",
        "fr": "Dump"
    },
    "description": null
}
```

Publishing Views
----------------

[](#publishing-views)

To publish the views, run:

```
php artisan vendor:publish --provider="Filamerce\\FilamentTranslatable\\FilamentTranslatableProvider" --tag="filament-translatable-views"
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

See the [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

See [CONTRIBUTING](.github/CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover any security-related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Lipis](https://github.com/lipis/flag-icons) for icons
- [Solution Forest](https://github.com/solutionforest/filament-translate-field) for great inspiration
- [Outer Web](https://github.com/outer-web/filament-translatable-fields) for the macro idea
- [All Contributors](../../contributors)

License
-------

[](#license)

Filament Translatable is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance68

Regular maintenance activity

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~20 days

Recently: every ~38 days

Total

9

Last Release

116d ago

Major Versions

v2.x-dev → v3.0.02025-08-29

### Community

Maintainers

![](https://www.gravatar.com/avatar/e34f6439ff69a5e372136c97bf9166d48010bfa7dd29af729e8a6db98d58335d?d=identicon)[webard](/maintainers/webard)

---

Top Contributors

[![webard](https://avatars.githubusercontent.com/u/855788?v=4)](https://github.com/webard "webard (43 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (2 commits)")

---

Tags

laraveltranslationslaravel-translatablelocalefilamentfilamentphpfilament-translate-fieldfilamercewebardspatie-translatableastrotomic-translatablefilament-translatable

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/filamerce-filament-translatable/health.svg)

```
[![Health](https://phpackages.com/badges/filamerce-filament-translatable/health.svg)](https://phpackages.com/packages/filamerce-filament-translatable)
```

###  Alternatives

[solution-forest/filament-translate-field

Filament Translate Field

47101.5k1](/packages/solution-forest-filament-translate-field)[bezhansalleh/filament-language-switch

Zero config Language Switch(Changer/Localizer) plugin for filamentphp admin

3431.0M16](/packages/bezhansalleh-filament-language-switch)[cactus-galaxy/filament-astrotomic

Filament support for Astrotomic's Laravel Translatable package.

2516.3k](/packages/cactus-galaxy-filament-astrotomic)[laravel-lang/locales

Basic functionality for working with localizations

134.5M12](/packages/laravel-lang-locales)[guava/filament-modal-relation-managers

Allows you to embed relation managers inside filament modals.

7565.0k4](/packages/guava-filament-modal-relation-managers)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
