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

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

optimistdigital/nova-translatable
=================================

A laravel-translatable extension for Laravel Nova.

3.0.4(5mo ago)202427.4k↓13.6%64[18 issues](https://github.com/outl1ne/nova-translatable/issues)5MITPHPPHP &gt;=8.1CI failing

Since Dec 30Pushed 5mo ago5 watchersCompare

[ Source](https://github.com/outl1ne/nova-translatable)[ Packagist](https://packagist.org/packages/optimistdigital/nova-translatable)[ RSS](/packages/optimistdigital-nova-translatable/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (72)Used By (5)

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

[](#nova-translatable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d7860a6da25cfa0e0ff5a67ec5be73a76ca61fd9273d0c84556424ec4bcd4581/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f75746c316e652f6e6f76612d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/outl1ne/nova-translatable)[![Total Downloads](https://camo.githubusercontent.com/7520e1b727c71766a1cc515799713cfd6b80e2e692b6ad43ca050b4885b9bd0d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f75746c316e652f6e6f76612d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/outl1ne/nova-translatable)

This [Laravel Nova](https://nova.laravel.com) allows you to make any input field `spatie/laravel-translatable` compatible and localisable.

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

[](#requirements)

- `PHP: ^8.0`
- `laravel/nova: ^4.12`
- `spatie/laravel-translatable: ^4.0 || ^5.0 || ^6.0`

Features
--------

[](#features)

- **Supports almost all fields** (including third party ones)
- **Supports default validation automatically**
- **Simple to implement** with minimal code changes (after `spatie/laravel-translatable` support)
- Locale tabs to switch between different locale values of the same field
- **Double click** on a tab to switch all fields to that locale
- Supports [nova-settings](https://github.com/outl1ne/nova-settings) package

Known non-working fields
------------------------

[](#known-non-working-fields)

- `Image` and `File`
    - Workarounds:
        - [outl1ne/nova-media-hub](https://github.com/outl1ne/nova-media-hub)
        - or any library that uploads images/files using XHR

Limitations
-----------

[](#limitations)

- The following methods can not be used, as this package uses them internally:
    - `resolveUsing`
    - `fillUsing`

Screenshots
-----------

[](#screenshots)

[![Detail View](./docs/detail.png)](./docs/detail.png)[![Form View](./docs/form.png)](./docs/form.png)[![Form View w/ Validation Errors](./docs/validation.png)](./docs/validation.png)

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

[](#installation)

Firstly, set up [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable).

Install the package in a Laravel Nova project via Composer:

```
# Install nova-translatable
composer require outl1ne/nova-translatable

# Publish configuration (optional, but useful for setting default locales)
php artisan vendor:publish --tag="nova-translatable-config"
```

Usage
-----

[](#usage)

Call `->translatable()` on any field, like so:

```
// Any Nova field
Text::make('Name')
  ->rules('required', 'min:2')
  ->translatable(),

// Any third-party input field
Multiselect::make('Football teams')
  ->rules('required')
  ->translatable(),

// Optionally pass custom locales on a per-field basis
Number::make('Population')
  ->translatable([
    'en' => 'English',
    'et' => 'Estonian',
  ]),
```

Validation
----------

[](#validation)

It's possible to define locale specific validation rules.

To do so, add the `->rulesFor()` on your field and the `HandlesTranslatable` trait to your Nova resource.

`->rulesFor` accepts `array|string|callable` locales and `array|callable` rules.

```
use Outl1ne\NovaTranslatable\HandlesTranslatable;

class Product extends Resource
{
    use HandlesTranslatable;

    public function fields(Request $request)
    {
        return [
            Text::make(__('Name'), 'name')
                ->sortable()
                ->translatable()
                ->rules(['max:255'])
                ->rulesFor('en', [
                    'required',
                ])
                ->rulesFor(['en', 'et'], function ($locale) {
                    return ["unique:products,name->$locale{{resourceId}}"];
                }),
        ];
    }
}
```

#### In this example, rules will be added to the following values

[](#in-this-example-rules-will-be-added-to-the-following-values)

```
max: name.*
required: name.en
unique: name.en & name.et
```

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

[](#configuration)

You can define default locales for all the `translatable` fields in the config file. The config file can be published using:

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

### Fill other locales from config option

[](#fill-other-locales-from-config-option)

The configuration option `fill_other_locales_from` allows you to pre-fill other locales from just one locale. This requires the resources to also have the `HandlesTranslatable` trait.

### One select for all fields on a page

[](#one-select-for-all-fields-on-a-page)

If you don't want to display the locale select next to each field, you can set the `display_type` to `none` and add a `Outl1ne\NovaTranslatable\Fields\LocaleSelect` field to your Nova resource. This will render a single select for all fields.

### Custom locale display

[](#custom-locale-display)

To customize the locale display you can use `Nova::provideToScript` to pass `customLocaleDisplay` as in the example below.

```
// in app/Providers/NovaServiceProvider.php

public function boot()
{
    Nova::serving(function () {
        Nova::provideToScript([
            // ...
            'customLocaleDisplay' => [
                'en' => ,
                'et' => ,
            ]
        ]);
    });
}
```

Edge cases
----------

[](#edge-cases)

#### BelongsToMany allowDuplicateRelations corner-case

[](#belongstomany-allowduplicaterelations-corner-case)

When using this field inside a BelongsToMany as a pivot field with `->allowDuplicateRelations()` and you want to filter out exact matches using the `NotExactlyAttached` rule, use the `BelongsToManyTranslatable` field instead of the regular `BelongsToMany`.

Credits
-------

[](#credits)

- [Tarvo Reinpalu](https://github.com/Tarpsvo)

License
-------

[](#license)

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

###  Health Score

64

—

FairBetter than 99% of packages

Maintenance71

Regular maintenance activity

Popularity56

Moderate usage in the ecosystem

Community34

Small or concentrated contributor base

Maturity81

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83.3% 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 ~32 days

Recently: every ~91 days

Total

69

Last Release

153d ago

Major Versions

1.12.0 → 2.0.02022-05-02

2.3.2 → 3.0.02024-12-18

PHP version history (3 changes)1.0.0PHP &gt;=7.1.0

2.0.0PHP &gt;=8.0

3.0.0PHP &gt;=8.1

### Community

Maintainers

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

---

Top Contributors

[![Tarpsvo](https://avatars.githubusercontent.com/u/2018660?v=4)](https://github.com/Tarpsvo "Tarpsvo (300 commits)")[![KasparRosin](https://avatars.githubusercontent.com/u/33309407?v=4)](https://github.com/KasparRosin "KasparRosin (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (14 commits)")[![RobertoNegro](https://avatars.githubusercontent.com/u/28984898?v=4)](https://github.com/RobertoNegro "RobertoNegro (4 commits)")[![milewski](https://avatars.githubusercontent.com/u/2874967?v=4)](https://github.com/milewski "milewski (3 commits)")[![robertmarney](https://avatars.githubusercontent.com/u/48888686?v=4)](https://github.com/robertmarney "robertmarney (3 commits)")[![umimehar](https://avatars.githubusercontent.com/u/11488033?v=4)](https://github.com/umimehar "umimehar (3 commits)")[![ngiraud](https://avatars.githubusercontent.com/u/12152071?v=4)](https://github.com/ngiraud "ngiraud (3 commits)")[![bastihilger](https://avatars.githubusercontent.com/u/1419634?v=4)](https://github.com/bastihilger "bastihilger (2 commits)")[![Gertiozuni](https://avatars.githubusercontent.com/u/26062255?v=4)](https://github.com/Gertiozuni "Gertiozuni (2 commits)")[![trippo](https://avatars.githubusercontent.com/u/497169?v=4)](https://github.com/trippo "trippo (2 commits)")[![RomkaLTU](https://avatars.githubusercontent.com/u/10167743?v=4)](https://github.com/RomkaLTU "RomkaLTU (1 commits)")[![royduin](https://avatars.githubusercontent.com/u/1703233?v=4)](https://github.com/royduin "royduin (1 commits)")[![srinathreddydudi](https://avatars.githubusercontent.com/u/10626045?v=4)](https://github.com/srinathreddydudi "srinathreddydudi (1 commits)")[![stepanenko3](https://avatars.githubusercontent.com/u/31134245?v=4)](https://github.com/stepanenko3 "stepanenko3 (1 commits)")[![jan-tricks](https://avatars.githubusercontent.com/u/113358501?v=4)](https://github.com/jan-tricks "jan-tricks (1 commits)")[![xcalder](https://avatars.githubusercontent.com/u/6959235?v=4)](https://github.com/xcalder "xcalder (1 commits)")[![farrrr](https://avatars.githubusercontent.com/u/1716558?v=4)](https://github.com/farrrr "farrrr (1 commits)")[![voidgraphics](https://avatars.githubusercontent.com/u/9298484?v=4)](https://github.com/voidgraphics "voidgraphics (1 commits)")[![webstack9](https://avatars.githubusercontent.com/u/58256527?v=4)](https://github.com/webstack9 "webstack9 (1 commits)")

---

Tags

laraveli18ntranslatetranslatablenova

### Embed Badge

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

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

###  Alternatives

[outl1ne/nova-translatable

A laravel-translatable extension for Laravel Nova.

203416.9k8](/packages/outl1ne-nova-translatable)[spatie/nova-translatable

Making Nova fields translatable

2231.5M1](/packages/spatie-nova-translatable)[badinansoft/nova-language-switch

A Laravel Nova package to switch language in your application

26506.4k1](/packages/badinansoft-nova-language-switch)[statikbe/laravel-nova-chained-translation-manager

The Laravel Nova Chained Translation Manager allows you to easily edit and customise the translations of your current Laravel environment.

1628.6k](/packages/statikbe-laravel-nova-chained-translation-manager)

PHPackages © 2026

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