PHPackages                             nathaniel3456/nova-astrotranslatable - 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. nathaniel3456/nova-astrotranslatable

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

nathaniel3456/nova-astrotranslatable
====================================

An astrotomic/laravel-translatable extension for Laravel Nova.

05PHP

Since Sep 6Pushed 8mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Nova Astrotomic Translatable
============================

[](#nova-astrotomic-translatable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1c916cb73ea418cf106c3b00f92023ce1f26106c6f952dbd8b5c3d9ff5878dff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e617468616e69656c333435362f6e6f76612d617374726f7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nathaniel3456/nova-astrotranslatable)[![Total Downloads](https://camo.githubusercontent.com/285a03264f719d545838d9510e4fb5333d622307e1d9317571d06e845b614327/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e617468616e69656c333435362f6e6f76612d617374726f7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/nathaniel3456/nova-astrotranslatable)

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

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

[](#requirements)

- `PHP: >=8.2`
- `laravel/nova: ^5.0`
- `astrotomic/laravel-translatable: ^11.10`

Version Compatibility
---------------------

[](#version-compatibility)

With the release of Nova 5.0, there are now two separate versions of Nova Translatable. Unfortunately due to the nature of the update, the new one isn't backwards compatible. So please choose your version accordingly.

Laravel NovaNova Translatable4.02.15.05.0Features
--------

[](#features)

- **Supports almost all fields** (including third party ones)
- **Supports default validation automatically**
- **Simple to implement** with minimal code changes (after `astrotomic/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)

 Form View [![Detail view](./docs/detail.png)](./docs/detail.png) Form View [![Form view](./docs/form.png)](./docs/form.png) Form View w/ Validation Errors [![Form view with validation errors](./docs/validation.png)](./docs/validation.png)Installation
------------

[](#installation)

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

Install the package in a Laravel Nova project via Composer:

```
# Install nova-astrotranslatable
composer require nathaniel3456/nova-astrotranslatable

# 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 Nathaniel3456\NovaAstrotranslatable\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-astrotranslatable-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 `Nathaniel3456\NovaAstrotranslatable\Fields\LocaleSelect` field to your Nova resource. This will render a single select for all fields.

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)
- [Optimist Digital](https://github.com/optimistdigital)

License
-------

[](#license)

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

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance43

Moderate activity, may be stable

Popularity5

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 85.8% 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.

### Community

Maintainers

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

---

Top Contributors

[![Tarpsvo](https://avatars.githubusercontent.com/u/2018660?v=4)](https://github.com/Tarpsvo "Tarpsvo (242 commits)")[![kiritokatklian](https://avatars.githubusercontent.com/u/6556281?v=4)](https://github.com/kiritokatklian "kiritokatklian (11 commits)")[![KasparRosin](https://avatars.githubusercontent.com/u/33309407?v=4)](https://github.com/KasparRosin "KasparRosin (7 commits)")[![milewski](https://avatars.githubusercontent.com/u/2874967?v=4)](https://github.com/milewski "milewski (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)")[![trippo](https://avatars.githubusercontent.com/u/497169?v=4)](https://github.com/trippo "trippo (2 commits)")[![mikepluquin](https://avatars.githubusercontent.com/u/38099131?v=4)](https://github.com/mikepluquin "mikepluquin (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)")[![farrrr](https://avatars.githubusercontent.com/u/1716558?v=4)](https://github.com/farrrr "farrrr (1 commits)")[![xcalder](https://avatars.githubusercontent.com/u/6959235?v=4)](https://github.com/xcalder "xcalder (1 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (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)")[![nathaniel3456](https://avatars.githubusercontent.com/u/70720174?v=4)](https://github.com/nathaniel3456 "nathaniel3456 (1 commits)")

### Embed Badge

![Health badge](/badges/nathaniel3456-nova-astrotranslatable/health.svg)

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

###  Alternatives

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.0k](/packages/symfony-translation)[nesbot/carbon

An API extension for DateTime that supports 281 different languages.

169661.4M4.8k](/packages/nesbot-carbon)[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M491](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)

PHPackages © 2026

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