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

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

optimistdigital/nova-lang
=========================

A Laravel Nova tool.

1.3.0(5y ago)1411.9k↓23.3%2MITVuePHP &gt;=7.1.0

Since Nov 8Pushed 1y ago2 watchersCompare

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

READMEChangelog (5)DependenciesVersions (6)Used By (0)

Nova Lang
=========

[](#nova-lang)

[Laravel Nova](https://nova.laravel.com) package that allows you to set localization of content.

[![NovaLang](./docs/novalang.gif)](./docs/novalang.gif)

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

[](#installation)

Install the package in a Laravel Nova project via Composer and run migrations:

```
# Install package
composer require optimistdigital/nova-lang
```

Publish the `nova-lang` configuration file and edit it to your preference:

```
php artisan vendor:publish --provider="OptimistDigital\NovaLang\ToolServiceProvider" --tag="config"
```

Register the tool with Nova in the `tools()` method of the `NovaServiceProvider`:

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

public function tools()
{
    return [
        // ...
        new \OptimistDigital\NovaLang\NovaLang
    ];
}
```

Defining locales
----------------

[](#defining-locales)

```
// in /config/nova-lang.php

// ...
'locales' => [
  'en' => 'English',
  'et' => 'Estonian',
],

// OR

'locales' => function () {
  return Locale::all()->pluck('name', 'key');
},
```

After defining locales in /config/nova-lang.php, you can use helper function.

```
$locales = nova_lang_get_all_locales();

//or you can use it in another package.

'locales' => nova_lang_get_all_locales(),
```

Usage
-----

[](#usage)

### Creating the field

[](#creating-the-field)

```
$fields[] = NovaLangField::make('Locale', 'locale');
```

If you are using a translation package like nova-locale-field, you can also give locale\_parent\_id. localeParentId has to be optainable through url query. Make sure you have defined locale\_parent\_id in your database.

```
$fields[] = NovaLangField::make('Locale', 'locale', 'locale_parent_id')
```

### Sort resources by locale

[](#sort-resources-by-locale)

```
//Your resource file, where you have returned $fields array
public static function indexQuery(NovaRequest $request, $query)
{
    $localeColumn = 'your_table_name' . 'locale'
    $query->where(function ($subQuery) use ($localeColumn) {
        $subQuery->where($localeColumn, nova_lang_get_active_locale())
            ->orWhereNotIn($localeColumn, array_keys(nova_lang_get_all_locales()));
    });
    return $query;
}
```

Credits
-------

[](#credits)

- [Kaspar Rosin](https://github.com/KasparRosin)

License
-------

[](#license)

Nova page manager is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~89 days

Total

5

Last Release

2028d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c80ca2be0e3f88f4422fae771026154c71332ad8b4dde5ea4fd41807dbbabba?d=identicon)[KasparRosin](/maintainers/KasparRosin)

---

Top Contributors

[![liorocks](https://avatars.githubusercontent.com/u/534610?v=4)](https://github.com/liorocks "liorocks (4 commits)")[![Tarpsvo](https://avatars.githubusercontent.com/u/2018660?v=4)](https://github.com/Tarpsvo "Tarpsvo (2 commits)")

---

Tags

laravel-novalaravel-nova-toollocalenovalaravelnovaoptimistdigital

### Embed Badge

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

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

###  Alternatives

[outl1ne/nova-translations-loader

This Laravel Nova package helps developers load translations into their packages.

395.1M42](/packages/outl1ne-nova-translations-loader)[optimistdigital/nova-translations-loader

This Laravel Nova package helps developers load translations into their packages.

393.7M10](/packages/optimistdigital-nova-translations-loader)[spatie/nova-translatable

Making Nova fields translatable

2231.5M1](/packages/spatie-nova-translatable)[outl1ne/nova-translatable

A laravel-translatable extension for Laravel Nova.

203416.9k8](/packages/outl1ne-nova-translatable)[badinansoft/nova-language-switch

A Laravel Nova package to switch language in your application

26506.4k1](/packages/badinansoft-nova-language-switch)[optimistdigital/nova-locale-manager

Laravel Nova tool to manage locales.

167.0k](/packages/optimistdigital-nova-locale-manager)

PHPackages © 2026

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