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 yesterday

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

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity37

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://www.gravatar.com/avatar/6b5da68c7b554cb3fdea5661e6dfaa7c9928546e1632cf5d135d75f7d2753fd0?d=identicon)[tommasomatteini](/maintainers/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

[symfony/translation

Provides tools to internationalize your application

6.6k836.5M2.1k](/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.4M495](/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)
