PHPackages                             rene-roscher/laravel-i18n-json-converter - 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. rene-roscher/laravel-i18n-json-converter

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

rene-roscher/laravel-i18n-json-converter
========================================

A Package for Laravel that converts PHP array-based translation files into flattened JSON files, making them compatible with Vue i18n

1.0.2(1y ago)0780↓67.5%[3 PRs](https://github.com/Rene-Roscher/laravel-i18n-json-converter/pulls)MITPHPPHP &gt;=8.2CI passing

Since Mar 7Pushed 1w ago1 watchersCompare

[ Source](https://github.com/Rene-Roscher/laravel-i18n-json-converter)[ Packagist](https://packagist.org/packages/rene-roscher/laravel-i18n-json-converter)[ Docs](https://github.com/rene-roscher/laravel-i18n-json-converter)[ GitHub Sponsors](https://github.com/Rene-Roscher)[ RSS](/packages/rene-roscher-laravel-i18n-json-converter/feed)WikiDiscussions main Synced 3d ago

READMEChangelog (3)Dependencies (8)Versions (8)Used By (0)

[![PVM Banner](assets/img.png)](assets/img.png)

A Package for Laravel that converts PHP array-based translation files into flattened JSON files, making them compatible with e.g. xiCO2k/laravel-vue-i18n
=========================================================================================================================================================

[](#a-package-for-laravel-that-converts-php-array-based-translation-files-into-flattened-json-files-making-them-compatible-with-eg-xico2klaravel-vue-i18n)

[![Latest Version on Packagist](https://camo.githubusercontent.com/5fe7219d091beb71b31cfb714f5978b6316d041d1be3edae4660d90a9a1630aa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72656e652d726f73636865722f6c61726176656c2d6931386e2d6a736f6e2d636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rene-roscher/laravel-i18n-json-converter)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/48ee566bda79cd5a100c73b194200831ca8460674baea791925ccdcd0e34877f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f72656e652d726f73636865722f6c61726176656c2d6931386e2d6a736f6e2d636f6e7665727465722f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/rene-roscher/laravel-i18n-json-converter/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/f6f52acc8e39d33fe983438d27e2b716e06fde235505bd3da5109839914e408a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72656e652d726f73636865722f6c61726176656c2d6931386e2d6a736f6e2d636f6e7665727465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rene-roscher/laravel-i18n-json-converter)

A Package for Laravel that converts PHP array-based translation files into flattened JSON files, making them compatible with [xiCO2k/laravel-vue-i18n](https://github.com/xiCO2k/laravel-vue-i18n).

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

[](#installation)

You can install the package via composer:

```
composer require rene-roscher/laravel-i18n-json-converter
```

You can convert your PHP array-based translation files into flattened JSON files by running the following command:

```
php artisan i18n:convert
```

Configure i18n for vue-i18n
---------------------------

[](#configure-i18n-for-vue-i18n)

```
import { i18nVue } from 'laravel-vue-i18n'

// Register the i18n plugin like this
// Tested with Vue 3 (Inertia) and Vite 4
// You need to add the locales manually to the switch, dynamic loading is not supported yet
app.use(i18nVue, {
    resolve: async (lang) => {
        const langFiles = import.meta.glob('../lang/*.json', { eager: true })

        let modules
        switch (lang) {
            case 'en':
                modules = import.meta.glob('../lang/json/en/*.json', { eager: true })
                break
            case 'de':
                modules = import.meta.glob('../lang/json/de/*.json', { eager: true })
                break
        }

        const messages = langFiles[`../lang/${lang}.json`] || {}

        for (const path in modules) {
            const regex = new RegExp(`../lang/json/${lang}/(.+)\\.json$`)
            const match = path.match(regex)
            if (match) {
                const prefix = match[1]
                const moduleMessages = modules[path].default
                for (const key in moduleMessages) {
                    messages.default[`${prefix}.${key}`] = moduleMessages[key]
                }
            }
        }

        return messages
    }
})
```

Changelog
---------

[](#changelog)

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

License
-------

[](#license)

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

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance73

Regular maintenance activity

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 57.1% 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 ~8 days

Total

3

Last Release

469d ago

PHP version history (2 changes)1.0.0PHP ^8.4

1.0.1PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fb36e30fba441ae796193c1f181cfba0489c29b2e6721227bbfe4dc8fe29bac?d=identicon)[Rene Roscher](/maintainers/Rene%20Roscher)

---

Top Contributors

[![Rene-Roscher](https://avatars.githubusercontent.com/u/43115138?v=4)](https://github.com/Rene-Roscher "Rene-Roscher (8 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")

---

Tags

laravelrene-roscherlaravel-i18n-json-converter

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/rene-roscher-laravel-i18n-json-converter/health.svg)

```
[![Health](https://phpackages.com/badges/rene-roscher-laravel-i18n-json-converter/health.svg)](https://phpackages.com/packages/rene-roscher-laravel-i18n-json-converter)
```

###  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.2M102](/packages/dedoc-scramble)[spatie/laravel-passkeys

Use passkeys in your Laravel app

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

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[elegantly/laravel-translator

All on one translations management for Laravel

6333.1k](/packages/elegantly-laravel-translator)

PHPackages © 2026

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