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 4w 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

Maturity39

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

[smarty-gettext/smarty-gettext

Gettext plugin enabling internationalization in Smarty Package files

752.5M8](/packages/smarty-gettext-smarty-gettext)[devaslanphp/auto-translate

Auto generate translation JSON files

6627.3k](/packages/devaslanphp-auto-translate)[renatomarinho/laravel-multi-language

Laravel Multi Language

235.1k](/packages/renatomarinho-laravel-multi-language)

PHPackages © 2026

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