PHPackages                             tommasomatteini/i18next-laravel-array-deployer - 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. tommasomatteini/i18next-laravel-array-deployer

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

tommasomatteini/i18next-laravel-array-deployer
==============================================

This utility deploys Laravel's translation arrays and make them capable compatible with i18next javascript module.

06PHP

Since Mar 21Pushed 7y ago1 watchersCompare

[ Source](https://github.com/tommasomatteini/i18next-laravel-array-deployer)[ Packagist](https://packagist.org/packages/tommasomatteini/i18next-laravel-array-deployer)[ RSS](/packages/tommasomatteini-i18next-laravel-array-deployer/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependenciesVersions (1)Used By (0)

i18next-laravel-array-deployer
==============================

[](#i18next-laravel-array-deployer)

Made for **Laravel 5.x**, tested on Laravel 5.7. To use with [laravel-localization-to-vue](https://github.com/kg-bot/laravel-localization-to-vue), [i18next](https://github.com/i18next/i18next) and [vue-i18next](https://github.com/panter/vue-i18next). I recommend using [i18next-xhr-backend](https://github.com/i18next/i18next-xhr-backend) and [i18next-localStorage-cache](https://github.com/i18next/i18next-localStorage-cache).

Example of code in routes/web.php:

```
...
use TommasoMatteini\i18NextLaravelArrayDeployer\ArrayDeployer;
...

/* i18n next passing values to i18next-xhr-backend */

Route::get('/locales/{lng}/{ns}.json', function ($lng, $ns) {
    $locales = ExportLocalization::export()->toArray(); // getData());
});

Route::post('/locales/{lng}/{ns}', function ($lng, $ns) {
    // do something with missing namespaces ($ns) and languages ($lng)
});

```

Example of code in app/Providers/AppServiceProvider.php:

```
...
use Illuminate\Support\Facades\View;
use KgBot\LaravelLocalization\Facades\ExportLocalizations as ExportLocalization;
use TommasoMatteini\i18NextLaravelArrayDeployer\ArrayDeployer;
...

class AppServiceProvider extends ServiceProvider
{

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        $translation = array();
        foreach (ExportLocalization::export()->toArray()['json'] as $key => $lng) {  https://github.com/i18next/jquery-i18next, to make this)
console.log(i18next.t('Hello World')); // ^ as above ^

```

My solution to get laravel global variables, in my resources/views/layouts/app.blade.php

```
...

...

    window.Laravel = {
        'csrfToken': '{{ csrf_token() }}',
        'baseUrl': '{{ url('/') }}',
        'locales': {
            'lng': '{{ app()->getLocale() }}',
            'fallbackLng': '{{ config('app.fallback_locale') }}',
            'translations': @if ($translation) @json($translation) @else {} @endif
        }
    };

...

```

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

[](#installation)

Use \[Composer\] to install the package:

```
$ composer require tommasomatteini/i18next-laravel-array-deployer

```

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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://avatars.githubusercontent.com/u/13198768?v=4)[Tommaso Matteini](/maintainers/tommasomatteini)[@tommasomatteini](https://github.com/tommasomatteini)

---

Top Contributors

[![tommasomatteini](https://avatars.githubusercontent.com/u/13198768?v=4)](https://github.com/tommasomatteini "tommasomatteini (11 commits)")

---

Tags

laravel57

### Embed Badge

![Health badge](/badges/tommasomatteini-i18next-laravel-array-deployer/health.svg)

```
[![Health](https://phpackages.com/badges/tommasomatteini-i18next-laravel-array-deployer/health.svg)](https://phpackages.com/packages/tommasomatteini-i18next-laravel-array-deployer)
```

###  Alternatives

[smmoosavi/php-gettext

Wrapper for php-gettext by danilo segan. This library provides PHP functions to read MO files even when gettext is not compiled in or when appropriate locale is not present on the system.

1926.6k1](/packages/smmoosavi-php-gettext)[laradevs/spanish

labels translated to spanish

166.7k](/packages/laradevs-spanish)

PHPackages © 2026

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