PHPackages                             centrust/nova-localization - 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. centrust/nova-localization

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

centrust/nova-localization
==========================

Laravel Nova Localization Package

3.0.1(1y ago)2481MITPHPPHP ^8.1|^8.2

Since Oct 30Pushed 1y ago1 watchersCompare

[ Source](https://github.com/centrust/nova-localization)[ Packagist](https://packagist.org/packages/centrust/nova-localization)[ Docs](https://github.com/centrust/nova-localization)[ RSS](/packages/centrust-nova-localization/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (16)Versions (20)Used By (0)

Laravel Nova Inline Arabic Localization (Translation)
=====================================================

[](#laravel-nova-inline-arabic-localization-translation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d40a82aca984b8b7e66fa6ff8999ea7a10e6ec571e0dbc808417da50ca724c6d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63656e74727573742f6e6f76612d6c6f63616c697a6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/centrust/nova-localization)[![GitHub Tests Action Status](https://camo.githubusercontent.com/9c61af650a57c54f0802d55cac9f752734f6964f5442ad560649f75324568a0c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63656e74727573742f6e6f76612d6c6f63616c697a6174696f6e2f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/centrust/nova-localization/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/d34e5d456f2b5daac13566ee4fa39e8fb95ec54d453ed2d87e10efd91fbbe134/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f63656e74727573742f6e6f76612d6c6f63616c697a6174696f6e2f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/centrust/nova-localization/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/4444868fbe379d59d60479edc680097064f0424ae3f40544a47adf676ceb9451/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63656e74727573742f6e6f76612d6c6f63616c697a6174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/centrust/nova-localization)

This package is tailored for developers using Laravel Nova who need an easy, reliable solution for managing their application's translations.

### Currently Only Supports English and Arabic languages.You are free to fork and add your own language support.

[](#currently-only-supports-english-and-arabic-languagesyou-are-free-to-fork-and-add-your-own-language-support)

Features
--------

[](#features)

- **Inline Translation**: Automatically translates your application's text from the dashboard.
- **Flexibility**: Designed to work seamlessly with Laravel's built-in localization functionality.
- **Easiness**: An easy configuration process ensures you can start using instantly.

Example Use
-----------

[](#example-use)

in Nova Resource

```
  Text::make(_tran('Name'), 'name'),
  Text::make(_tran('Description'), 'description')
```

Result

- ِِArabic الأسم
- English Name
- ِِArabic التعريف
- English Description

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

[](#installation)

You can install the package via composer:

```
composer require centrust/nova-localization
```

You can publish and run the migrations with:

```
php artisan vendor:publish --tag="nova-localization-migrations"
php artisan migrate
```

> Once you Migrate the table, you need to add 'locale' column to your User Model fillable array.

You can publish the config file with:

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

This is the contents of the published config file:

```
return [
  /**
     * If set to true, this will enable caching for localization. The actual value for this translation is taken from the server's cache.
     * If the LOCALIZATION_ENABLE_CACHE environment variable does not exist, the default value will be false.
     * This is useful for improving the application's performance by caching localizations,
     * but it might delay the appearance of any changes made to localization files until the cache is refreshed.
     **/
    'localization_enable_cache' => env('LOCALIZATION_ENABLE_CACHE', false),

    /**
     * This URL is for loading the Arabic font from Google Fonts.
     * This font is needed for Arabic language support in your application.
     **/
    'ar_google_font_url'=> 'https://fonts.googleapis.com/css2?family=Scheherazade+New:wght@700&display=swap',

    /**
     * This is the path to the CSS file that contains the Arabic font family.
     * example : 'css/rtl-ar.css'
     * The file must be in the public folder.
     * This font is needed for Arabic language support in your application.
     */
    'ar_font_family_css'=> 'css/rtl-ar.css',

];
```

Example for the CSS file that contains the Arabic font family.

```
body {
    font-family: 'Scheherazade New', 'Nunito Sans', 'Nunito', sans-serif;
}
```

Usage
-----

[](#usage)

#### To translate any text in your application, you can use the \_tran() helepr function:

[](#to-translate-any-text-in-your-application-you-can-use-the-_tran-helepr-function)

```
_tran('This is a label');
```

To show the Localization Resource in the menu, (I havent figured out how to show it automatically yet) but you can add it manually by Creating your own normal resource and extend this package resource

```
use Centrust\NovaLocalization\Nova\NovaLocalizationResource;

class Localization extends NovaLocalizationResource
{

}
```

To have the user switch languages in the User menu, you can add this to your User Menu in the Novaserviceprovider.php

```
  Nova::userMenu(function (Request $request, Menu $menu) {

            $language = app()->getLocale() == 'ar' ? 'en' : 'ar';

            $menu->append(MenuItem::externalLink(app()->getLocale() == 'ar' ? 'English' : 'عربي', '/change-language/' . $language . '/' . $request->user()->id));

            return $menu;
        });
```

This part will switch the locale and to RTL if 'Arabic' is selected

How It works
------------

[](#how-it-works)

- When you use the \_tran() function, which is a global helper function, available in all your application's files,
- the package will search for the translation in the database,
- if it does not find it, it will search for it in the Laravel language files.
- If it does not find it in the language files, it will save it in the database and return it to you.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

Please review [our security policy](../../security/policy) on how to report security vulnerabilities.

Credits
-------

[](#credits)

- [Salah Elabbar](https://github.com/centrust)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 60.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 ~26 days

Recently: every ~48 days

Total

18

Last Release

531d ago

Major Versions

1.0.0 → 2.0.02023-12-16

2.2.0 → 3.02025-01-17

PHP version history (2 changes)1.0.0PHP ^8.1

3.0PHP ^8.1|^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/27489191?v=4)[centrust](/maintainers/centrust)[@centrust](https://github.com/centrust)

---

Top Contributors

[![Elshaden](https://avatars.githubusercontent.com/u/33955172?v=4)](https://github.com/Elshaden "Elshaden (17 commits)")[![centrust](https://avatars.githubusercontent.com/u/27489191?v=4)](https://github.com/centrust "centrust (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laravelcentrustnova-localization

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/centrust-nova-localization/health.svg)

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k102.4M1.4k](/packages/spatie-laravel-permission)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M99](/packages/dedoc-scramble)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.3k3](/packages/defstudio-telegraph)[spatie/laravel-passkeys

Use passkeys in your Laravel app

471890.7k38](/packages/spatie-laravel-passkeys)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)

PHPackages © 2026

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