PHPackages                             backtik-ch/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. backtik-ch/filament-translatable

ActiveLibrary[Localization &amp; i18n](/categories/localization)

backtik-ch/filament-translatable
================================

This packages provides a simple way to translate Filament texts with AI (or manually). It is to be used in combination with Spatie's Laravel Translatable package.

0.1.0(2w ago)014[1 PRs](https://github.com/backtik-ch/filament-translatable/pulls)MITPHPPHP ^8.3CI passing

Since May 22Pushed 1w agoCompare

[ Source](https://github.com/backtik-ch/filament-translatable)[ Packagist](https://packagist.org/packages/backtik-ch/filament-translatable)[ Docs](https://github.com/backtik-ch/filament-translatable)[ GitHub Sponsors](https://github.com/backtik-ch)[ RSS](/packages/backtik-ch-filament-translatable/feed)WikiDiscussions 5.x Synced 1w ago

READMEChangelog (1)Dependencies (11)Versions (3)Used By (0)

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

[](#filament-translatable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7f8508cbda5ccc34b7458d4413f2088207a0a2b42ee2eed8bfc8f071c50cd864/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6261636b74696b2d63682f66696c616d656e742d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/backtik-ch/filament-translatable)[![Total Downloads](https://camo.githubusercontent.com/a63a9bf768fd98aaa6b90e4ccdc3541a753a0304f7d8fd806a60d977bc1f4420/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6261636b74696b2d63682f66696c616d656e742d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/backtik-ch/filament-translatable)

A Filament 4 &amp; 5 plugin that provides translatable form fields and infolist entries with AI-powered translation generation via [laravel/ai](https://github.com/laravel/ai). Designed to work with [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable).

Features
--------

[](#features)

- **TranslatableInput** — A form field with two display modes: modal (default) or inline
- **TranslatableEntry** — An infolist entry with two display modes: inline (expandable) or modal
- **AI Translation** — Generate all translations in a single API call using structured output
- **Configurable** — Set languages, source locale, AI provider/model globally or per-panel
- **Disable AI** — Optionally disable the AI section while keeping manual translation editing

Requirements
------------

[](#requirements)

- PHP ^8.3
- Laravel ^12.0 | ^13.0
- Filament ^4.0 | ^5.0

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

[](#installation)

```
composer require backtik-ch/filament-translatable
```

Publish the config file:

```
php artisan vendor:publish --tag="filament-translatable-config"
```

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

[](#configuration)

```
// config/filament-translatable.php

return [
    'languages' => ['fr', 'de', 'it', 'en'],
    'source_locale' => 'fr',
    'ai' => [
        'enabled' => env('FILAMENT_TRANSLATABLE_AI_ENABLED', true),
        'provider' => env('FILAMENT_TRANSLATABLE_AI_PROVIDER', 'anthropic'),
        'model' => env('FILAMENT_TRANSLATABLE_AI_MODEL', 'claude-haiku-4-5-20251001'),
        'prompt' => 'Translate the following text from :source_language to :target_language. Return only the translation, nothing else.',
    ],
];
```

### API Keys

[](#api-keys)

API keys are managed by `laravel/ai`. Add the relevant key to your `.env`:

```
# Anthropic
ANTHROPIC_API_KEY=sk-ant-...

# OpenAI
OPENAI_API_KEY=sk-...

# Disable AI (keep manual editing only)
FILAMENT_TRANSLATABLE_AI_ENABLED=false
```

See the [laravel/ai documentation](https://github.com/laravel/ai) for all supported providers.

Panel Plugin Setup
------------------

[](#panel-plugin-setup)

Register the plugin in your `PanelProvider`:

```
use Backtik\FilamentTranslatable\FilamentTranslatablePlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugin(
            FilamentTranslatablePlugin::make()
                ->languages(['fr', 'de', 'en'])
                ->sourceLocale('fr')
                ->aiProvider('openai')
                ->aiModel('gpt-4o-mini')
        );
}
```

All plugin methods are optional — values fall back to the config file.

Usage
-----

[](#usage)

### Model Setup

[](#model-setup)

Your model must use `spatie/laravel-translatable` and the translatable columns must be `json` in the database:

```
use Spatie\Translatable\HasTranslations;

class Post extends Model
{
    use HasTranslations;

    public $translatable = ['title', 'description'];
}
```

### Form Field

[](#form-field)

```
use Backtik\FilamentTranslatable\Forms\Components\TranslatableInput;

// Simple text input (short content like titles)
TranslatableInput::make('title')

// Textarea for longer content
TranslatableInput::make('description')->inputType('textarea')

// Inline mode — all locale fields rendered directly in the form
TranslatableInput::make('title')->inline()

// Inline textarea
TranslatableInput::make('description')->inline()->inputType('textarea')
```

#### Modal mode (default)

[](#modal-mode-default)

The field displays the source locale value as a readonly preview. Clicking the translate button opens a modal where you can:

1. Edit translations for each configured language
2. Select a source language
3. Click "Generate translations" to auto-translate all languages in one AI call

#### Inline mode

[](#inline-mode)

All locale fields are rendered directly in the form without requiring a modal. The AI generation section is also displayed inline. Best suited for forms where you want all translations visible at a glance.

### Infolist Entry

[](#infolist-entry)

```
use Backtik\FilamentTranslatable\Infolists\Components\TranslatableEntry;

// Inline mode (default) — shows all translations with expand/collapse
TranslatableEntry::make('title')

// Modal mode — shows source text, click to view all translations in a modal
TranslatableEntry::make('description')->modal()

// Truncate text to a specific number of lines
TranslatableEntry::make('description')->lineClamp(3)
TranslatableEntry::make('description')->modal()->lineClamp(2)
```

#### Inline mode (default)

[](#inline-mode-default)

Displays the first language inline with an expandable section to reveal the remaining translations.

#### Modal mode

[](#modal-mode)

Displays the source locale text directly. A "View translations" link opens a Filament modal showing all translations. Best for longer text content.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Credits
-------

[](#credits)

- [SimonMeia](https://github.com/backtik-ch)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance97

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

18d ago

Major Versions

0.1.0 → 5.x-dev2026-05-22

### Community

Maintainers

![](https://www.gravatar.com/avatar/628599896df86349601b75966b4c5029a909c84fe94fb3d0c7006a744f826f92?d=identicon)[SimonMeia](/maintainers/SimonMeia)

---

Top Contributors

[![SimonMeia](https://avatars.githubusercontent.com/u/92148227?v=4)](https://github.com/SimonMeia "SimonMeia (21 commits)")

---

Tags

laravelfilamentfilament-pluginfilamentphpfilament-translatablebacktik-ch

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[bezhansalleh/filament-language-switch

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

3571.2M21](/packages/bezhansalleh-filament-language-switch)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3913.7k](/packages/rawilk-profile-filament-plugin)[croustibat/filament-jobs-monitor

Background Jobs monitoring like Horizon for all drivers for FilamentPHP

264298.4k8](/packages/croustibat-filament-jobs-monitor)[marcelweidum/filament-passkeys

Use passkeys in your filamentphp app

6643.3k](/packages/marcelweidum-filament-passkeys)[dotswan/filament-map-picker

Easily pick and retrieve geo-coordinates using a map-based interface in your Filament applications.

127173.7k3](/packages/dotswan-filament-map-picker)[relaticle/custom-fields

User Defined Custom Fields for Laravel Filament

16345.8k](/packages/relaticle-custom-fields)

PHPackages © 2026

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