PHPackages                             guizoxxv/laravel-json-lang - 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. guizoxxv/laravel-json-lang

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

guizoxxv/laravel-json-lang
==========================

A package to export Laravel language files as JSON.

v1.0.1(1y ago)217MITPHP

Since Aug 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/guizoxxv/laravel-json-lang)[ Packagist](https://packagist.org/packages/guizoxxv/laravel-json-lang)[ RSS](/packages/guizoxxv-laravel-json-lang/feed)WikiDiscussions main Synced yesterday

READMEChangelog (2)DependenciesVersions (3)Used By (0)

Laravel JSON Lang
=================

[](#laravel-json-lang)

A package to export Laravel PHP translation files as JSON.

How it works
------------

[](#how-it-works)

This package adds a command that processes input files by grouping them according to their respective languages. For each language, a job is dispatched to enable parallel processing. This job handles the files by reading each translation key and updating it or not, in a JSON translation file. The JSON translation keys are structured to ensure that the translation helper function works the same way as it would if the translations were coming from PHP files.

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

[](#installation)

1. Require the package via Composer:

```
composer require guizoxxv/laravel-json-lang --dev

```

2. Publish the package's configuration file:

```
php artisan vendor:publish --provider="Guizoxxv\LaravelJsonLang\LaravelJsonLangServiceProvider"

```

3. Run the command to export files:

```
php artisan laravel-json-lang:export

```

Configuration
-------------

[](#configuration)

The following configuration parameters are available:

### 1. input\_paths

[](#1-input_paths)

An array of target file system paths to be processed. Each element in the array should be a string representing either a file path or a directory path. The path should be absolute, starting from the root of the application.

Example:

```
'input_paths' => [
    '/path/to/file.php',
    '/path/to/directory'
]
```

In this example, `/path/to/specific/file.php` is a single file that will be processed, while all `.php` files within `/path/to/directory/` and its subdirectories will also be processed.

**Vendor prefix**

When using package translations, a key/value pair with the path as key and package namespace as value to indicate the correct translation prefix.

Example:

```
'input_paths' => [
    '/lang/en/validation.php' => 'myPackage',
]
```

```
echo trans('myPackage::validation.required');
```

### 2. output\_path

[](#2-output_path)

Specifies the directory where the JSON translation files should be saved.

### 3. override\_existing\_keys

[](#3-override_existing_keys)

If a key already exists in the JSON translation files, specifies whether to keep the ones in the JSON file (`false`) or override with the value from the PHP file being processed (`true`).

### 4. languages

[](#4-languages)

An array (allowlist) of languages to be processed. When not provided, all available languages will be processed.

Observations
------------

[](#observations)

1. This package reads the full content of translation files into memory. Should you encounter memory issues, try reducing the number of languages being processed at once.

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

677d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67ccf02679b542b46bd234e02bd7159bcf262a0faa9697ab3305d1269e951b80?d=identicon)[Guizo](/maintainers/Guizo)

---

Top Contributors

[![guizoxxv](https://avatars.githubusercontent.com/u/20052395?v=4)](https://github.com/guizoxxv "guizoxxv (9 commits)")

---

Tags

laravellaravel-localizationtranslation

### Embed Badge

![Health badge](/badges/guizoxxv-laravel-json-lang/health.svg)

```
[![Health](https://phpackages.com/badges/guizoxxv-laravel-json-lang/health.svg)](https://phpackages.com/packages/guizoxxv-laravel-json-lang)
```

###  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.

1927.0k1](/packages/smmoosavi-php-gettext)

PHPackages © 2026

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