PHPackages                             elaborate-code/laravel-json-tongue - 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. elaborate-code/laravel-json-tongue

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

elaborate-code/laravel-json-tongue
==================================

Use multiple JSON files per locale on Laravel

v0.3.0(3y ago)19[1 issues](https://github.com/elaborate-code/laravel-json-tongue/issues)MITPHPPHP ^8.0

Since Oct 7Pushed 3y agoCompare

[ Source](https://github.com/elaborate-code/laravel-json-tongue)[ Packagist](https://packagist.org/packages/elaborate-code/laravel-json-tongue)[ Docs](https://github.com/elaborate-code/laravel-json-tongue)[ RSS](/packages/elaborate-code-laravel-json-tongue/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (13)Versions (6)Used By (0)

Laravel JSON tongue
===================

[](#laravel-json-tongue)

[![Latest Version on Packagist](https://camo.githubusercontent.com/06ca9f029717bc4b62e3d6239c40a6ad71a39209960b0fdd6c0e4dcb3b6e2935/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c61626f726174652d636f64652f6c61726176656c2d6a736f6e2d746f6e6775652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elaborate-code/laravel-json-tongue)[![GitHub Tests Action Status](https://camo.githubusercontent.com/28ba3caf2fe22294eabe2121fd996acd341b6f8fcbc678e7a4b11fd10bf5a279/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656c61626f726174652d636f64652f6c61726176656c2d6a736f6e2d746f6e6775652f72756e2d74657374732e796d6c3f6272616e63683d6d61696e)](https://github.com/elaborate-code/laravel-json-tongue/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/63a13b09eccdb32b47029ec6784f51a9da514304dd25413d9c4064f2a758bc93/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f656c61626f726174652d636f64652f6c61726176656c2d6a736f6e2d746f6e6775652f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e)](https://github.com/elaborate-code/laravel-json-tongue/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/3cf7f50403c3fef5b036276e08d8869e6764fb4a8cddbc542ab6c815593f9d38/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f656c61626f726174652d636f64652f6c61726176656c2d6a736f6e2d746f6e6775652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/elaborate-code/laravel-json-tongue)[![maintained](https://camo.githubusercontent.com/9706e3e18c3eb917abaea07fe5eb9ecd7f6c22980353c2a091c528d5f452b1ba/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f32303233)](https://camo.githubusercontent.com/9706e3e18c3eb917abaea07fe5eb9ecd7f6c22980353c2a091c528d5f452b1ba/68747470733a2f2f696d672e736869656c64732e696f2f6d61696e74656e616e63652f7965732f32303233)[![Production ready](https://camo.githubusercontent.com/bf2af9c8c08732324e3e7b4f7e5aa699d4fd9eb83b3f16ab9062689efaa68df3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50726f64756374696f6e25323072656164792d6e6f2d726564)](https://camo.githubusercontent.com/bf2af9c8c08732324e3e7b4f7e5aa699d4fd9eb83b3f16ab9062689efaa68df3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f50726f64756374696f6e25323072656164792d6e6f2d726564)

This package is built on top of [PHP JSON tongue](https://github.com/elaborate-code/php-json-tongue) to enable the usage of multiple JSON files per locale on Laravel.

Introduction
------------

[](#introduction)

Starting with Laravel docs:

> Translation strings may be defined within JSON files that are placed within the lang directory. When taking this approach, **each language supported by your application would have a corresponding JSON file** within this directory. This approach is recommended for applications that have a large number of translatable strings.

[Read more...](https://laravel.com/docs/9.x/localization#using-translation-strings-as-keys)

Intuitively, many developers wonder why isn't it possible to have **each language supported by their application have multiple corresponding JSON files**. Multiple JSON files allows grouping strings by topic, and keeping the files small and clear.

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

[](#installation)

Install the package via composer:

```
composer require elaborate-code/laravel-json-tongue
```

### Requirements

[](#requirements)

- PHP 8.0 or higher.

Usage
-----

[](#usage)

File structure example:

[![example](https://raw.githubusercontent.com/elaborate-code/php-json-tongue/main/illustration.png)](https://raw.githubusercontent.com/elaborate-code/php-json-tongue/main/illustration.png)

> The JSON files can co-exist with the PHP files without any conflicts!

### The merge command

[](#the-merge-command)

This command loads all the JSON files from `/` folders within the `/lang` folder and merge them per **locale** in new JSON files.

```
php artisan json-tongue:merge
```

Options:

OptionDescription`-F|--force`Removes JSON files that already exist in the root of the `lang` folder without asking> JSON files that already exist in the root of the `lang` folder, can be old JSON files previously generated by the command, or files that you have created manually and populated manually.
>
> ⚠️ In the second case be careful before instructing the command to remove existing JSON files!

#### Example

[](#example)

Before merging :

```
 lang
 ┣ 📂es
 ┃ ┣ 📜animals.json
 ┃ ┣ 📜greetings.json
 ┃ ┗ 📜jobs.json
 ┗ 📂fr
   ┣ 📜animals.json
   ┣ 📜greetings.json
   ┗ 📜jobs.json
```

After merging:

```
 lang
 ┣ 📂es
 ┃ ┣ 📜animals.json
 ┃ ┣ 📜greetings.json
 ┃ ┗ 📜jobs.json
 ┣ 📂fr
 ┃ ┣ 📜animals.json
 ┃ ┣ 📜greetings.json
 ┃ ┗ 📜jobs.json
 ┣ 📜es.json  ⭐ Usable by Laravel
 ┗ 📜fr.json  ⭐ Usable by Laravel
```

Testing
-------

[](#testing)

```
./vendor/bin/pest
```

Changelog
---------

[](#changelog)

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

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Help needed to add a watch command that refreshes the output JSON files with new translations added on the locale folders.

Credits
-------

[](#credits)

- [medilies](https://github.com/medilies)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

4

Last Release

1312d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e024d85d6159f76c1b1bc9c0608bdd2afab8b0724d0b9bb9ae45bf2a837d343f?d=identicon)[medilies](/maintainers/medilies)

---

Top Contributors

[![medilies](https://avatars.githubusercontent.com/u/35309918?v=4)](https://github.com/medilies "medilies (20 commits)")

---

Tags

internationalizationlanguageslaravellocalelocalizationpackagephp8translationlaravellocalizationelaborate-codelaravel-json-tongue

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/elaborate-code-laravel-json-tongue/health.svg)

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

###  Alternatives

[askdkc/breezejp

Laravel Starter Kit (Livewire+Breeze+Laravel UI+Jetstream)や標準のバリデーションメッセージを全て一瞬で日本語化し、言語切替機能も提供するパッケージです / This package provides all-in-one Japanese translation for Laravel StarterKit (Livewire StarterKit, Breeze, Laravel UI and Jetstream) packages and validation messages with language switching feature.

590244.8k1](/packages/askdkc-breezejp)[outhebox/laravel-translations

Manage your Laravel translations with a beautiful UI. Add, edit, delete, import, and export translations with ease.

80687.6k](/packages/outhebox-laravel-translations)[statikbe/laravel-filament-chained-translation-manager

A translation manager tool for Laravel Filament, that makes use of the Laravel Chained Translator.

92108.7k](/packages/statikbe-laravel-filament-chained-translation-manager)[vormkracht10/laravel-mails

Laravel Mails can collect everything you might want to track about the mails that has been sent by your Laravel app.

24149.7k](/packages/vormkracht10-laravel-mails)[elegantly/laravel-translator

All on one translations management for Laravel

6216.9k](/packages/elegantly-laravel-translator)[andrewdwallo/transmatic

Automate and streamline real-time text translations in your Laravel applications

5511.6k](/packages/andrewdwallo-transmatic)

PHPackages © 2026

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