PHPackages                             marshmallow/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. marshmallow/translatable

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

marshmallow/translatable
========================

Add translation to your Nova Resources. The translations will be stored in a translatables table and not in a JSON format in your existing tables as many packages out there do.

5.3.0(4mo ago)214.9k↓82.9%2[1 PRs](https://github.com/marshmallow-packages/translatable/pulls)3MITPHPPHP ^8.0CI failing

Since Oct 7Pushed 2w ago1 watchersCompare

[ Source](https://github.com/marshmallow-packages/translatable)[ Packagist](https://packagist.org/packages/marshmallow/translatable)[ Docs](https://marshmallow.dev)[ RSS](/packages/marshmallow-translatable/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (8)Versions (119)Used By (3)

[![alt text](https://camo.githubusercontent.com/f5450f299f5713ce2f04dd5a1ba7ce9960ed4568b3574e4c4ee3cddc75477253/68747470733a2f2f6d617273686d616c6c6f772e6465762f63646e2f6d656469612f6c6f676f2d7265642d3233377834362e706e67 "marshmallow.")](https://camo.githubusercontent.com/f5450f299f5713ce2f04dd5a1ba7ce9960ed4568b3574e4c4ee3cddc75477253/68747470733a2f2f6d617273686d616c6c6f772e6465762f63646e2f6d656469612f6c6f676f2d7265642d3233377834362e706e67)

Nova Translatable
=================

[](#nova-translatable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/040b3dd47fca8ffbfa0198e385b6351f52f4fcbbec731253970852c2db9f003f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d617273686d616c6c6f772f7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/marshmallow/translatable)[![Tests](https://camo.githubusercontent.com/427535643ad03345dcffe5e60cda6aa9f27a8d4c72411a6709fa1c91bf1c44f9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6d617273686d616c6c6f772d7061636b616765732f7472616e736c617461626c652f7068702d73796e7461782d636865636b65722e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/marshmallow-packages/translatable/actions/workflows/php-syntax-checker.yml)[![Total Downloads](https://camo.githubusercontent.com/34c24612a303be6c7bbd14ffb39e938ffab4344244d580c4c1152753e515b826/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d617273686d616c6c6f772f7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/marshmallow/translatable)[![License](https://camo.githubusercontent.com/c9ce1ade8bcd2e19aa1c52655c00ae3e92154647d48ab57c2677c339bb3cc869/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6d617273686d616c6c6f772d7061636b616765732f7472616e736c617461626c653f7374796c653d666c61742d737175617265)](https://github.com/marshmallow-packages/translatable/blob/main/LICENSE.md)

Add translation to your Nova Resources. The translations will be stored in a `translatables` table and not in a JSON format in your existing tables as many packages out there do.

[![](https://raw.githubusercontent.com/marshmallow-packages/translatable/main/resources/screenshots/translatable.png)](https://raw.githubusercontent.com/marshmallow-packages/translatable/main/resources/screenshots/translatable.png)

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

[](#installation)

You can install the package via composer:

```
composer require marshmallow/translatable
```

Publish the configuration:

```
php artisan vendor:publish --provider="Marshmallow\Translatable\ServiceProvider"
```

Run the install command. This updates `config/app.php`, syncs your existing language files into the database, syncs inline translations and generates the Nova resources:

```
php artisan translatable:install
```

Manual Installation
-------------------

[](#manual-installation)

If you prefer to install manually or the automatic installation doesn't work for your setup, follow these steps:

### 1. Add Default Locale Configuration

[](#1-add-default-locale-configuration)

Add the following line to your `config/app.php` file, right after the `'locale'` configuration:

```
'locale' => env('APP_LOCALE', 'en'),

'default_locale' => env('APP_LOCALE'),
```

### 2. Set Environment Variable

[](#2-set-environment-variable)

Make sure you have the `APP_LOCALE` environment variable set in your `.env` file:

```
APP_LOCALE=en
```

### 3. Run Migration and Synchronization Commands

[](#3-run-migration-and-synchronization-commands)

```
# Sync existing translation files to database
php artisan translatable:sync-file-to-database

# Sync missing translations
php artisan translatable:sync-missing

# Generate Nova resources (if using Laravel Nova)
php artisan marshmallow:resource Language Translatable --force
php artisan marshmallow:resource Translation Translatable --force
```

Usage
-----

[](#usage)

Please reference the official documentation at [Marshmallow Documentation](https://mrmallow.notion.site/Translatable-1c76ed0c3dbf8079b010fff1afc71986).

### Make a model translatable

[](#make-a-model-translatable)

Add the `Translatable` trait to any Eloquent model whose attributes you want to translate. When the trait is enabled, translated values are stored in the `translatables` table and the `translatable` relationship is eager loaded automatically to avoid N+1 queries.

```
use Illuminate\Database\Eloquent\Model;
use Marshmallow\Translatable\Traits\Translatable;

class Article extends Model
{
    use Translatable;
}
```

### Use Deepl integration

[](#use-deepl-integration)

This package contains an integration with Deepl. This integration will add a button to the translations index view, that will automaticly translate your text via Deepl. Just add the following ENV variable to use this awesome feature.

```
TRANSLATABLE_DEEPL_API_KEY=
```

This will use the free version of the Deepl API. If you have a paid subscription, you can add the following as well.

```
TRANSLATABLE_DEEPL_API_PATH=https://api.deepl.com
```

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

[](#configuration)

After publishing, the configuration lives in `config/translatable.php`:

KeyDefaultDescription`driver``database`Translation storage driver. Supported: `file`, `database`. Migrations are only loaded when set to `database`.`nova_translatable_fields``true`Show the language selector when editing a resource in Laravel Nova.`flag_icon``['height' => 40, 'width' => 40]`Ratios for the flag uploader.`translation_methods``['trans', '__']`Methods the scanner looks for when finding missing translations.`scan_paths``[app_path(), resource_path()]`Directories scanned when looking for missing translations.`models``Language`, `Translation`, `Translatable`, `MissingTranslation`Model classes used by the package. Override to swap in your own.`force_locale_query_string``force_locale`Query string parameter that forces the locale, useful for testing and deep linking.`deepl.api_path``env('TRANSLATABLE_DEEPL_API_PATH', 'https://api-free.deepl.com')`Deepl API endpoint.`deepl.api_key``env('TRANSLATABLE_DEEPL_API_KEY')`Deepl API key.`auto_translator.active``env('TRANSLATABLE_AUTO_TRANSLATOR_ACTIVE', false)`Enable the auto-translator.`missing_translations.active``env('MISSING_TRANSLATIONS_ACTIVE', false)`Enable missing-translation tracking.Artisan Commands
----------------

[](#artisan-commands)

The package ships the following Artisan commands:

CommandDescription`translatable:install`Install the package: update config, sync files to database and generate Nova resources.`translatable:add-language`Add a new language.`translatable:add-translation-key`Add a new translation key.`translatable:list-languages`List the configured languages.`translatable:list-missing`List missing translation keys.`translatable:sync-file-to-database`Sync existing language files into the database.`translatable:sync-missing`Sync missing translation keys.`translatable:sync-translations`Synchronise translations.`translatable:duplicates`Find duplicate translations.`translatable:fix-placeholders`Fix translated placeholders.`translatable:generate-preset`Generate a preset.`translatable:preset`Apply a preset.`translatable:index-missing-translatables`Index missing translatables.Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Stef van Esch](https://github.com/marshmallow-packages)
- [All Contributors](../../contributors)
- [joedixon](https://github.com/joedixon/laravel-translation)

License
-------

[](#license)

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

###  Health Score

56

—

FairBetter than 97% of packages

Maintenance86

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 61.2% 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 ~18 days

Total

110

Last Release

149d ago

Major Versions

v1.20.2 → v2.0.02022-05-04

v1.20.4 → v2.0.92022-06-29

v2.13.3 → 5.0.02025-08-07

PHP version history (3 changes)v1.0.0PHP &gt;=7.1.0

v1.7.1PHP ^7.1|^8.0

v2.0.0PHP ^8.0

### Community

Maintainers

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

---

Top Contributors

[![stefvanesch](https://avatars.githubusercontent.com/u/46725619?v=4)](https://github.com/stefvanesch "stefvanesch (284 commits)")[![LTKort](https://avatars.githubusercontent.com/u/2412670?v=4)](https://github.com/LTKort "LTKort (129 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (50 commits)")[![milan607](https://avatars.githubusercontent.com/u/258212842?v=4)](https://github.com/milan607 "milan607 (1 commits)")

---

Tags

laraveltranslatablenova

### Embed Badge

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

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

###  Alternatives

[outl1ne/nova-translatable

A laravel-translatable extension for Laravel Nova.

203469.9k10](/packages/outl1ne-nova-translatable)[optimistdigital/nova-translatable

A laravel-translatable extension for Laravel Nova.

202461.6k5](/packages/optimistdigital-nova-translatable)[elegantly/laravel-translator

All on one translations management for Laravel

6333.1k](/packages/elegantly-laravel-translator)[osama-98/laravel-enum-translatable

A Laravel package that provides translatable enum functionality with easy-to-use methods for working with enum values and their translations

561.2k](/packages/osama-98-laravel-enum-translatable)

PHPackages © 2026

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