{"id":22937928,"url":"https://github.com/elaborate-code/laravel-json-tongue","last_synced_at":"2026-05-03T02:41:54.020Z","repository":{"id":61053347,"uuid":"546887413","full_name":"elaborate-code/laravel-json-tongue","owner":"elaborate-code","description":"📦🌐 Use multiple JSON files per locale on Laravel","archived":false,"fork":false,"pushed_at":"2023-04-26T22:06:02.000Z","size":52,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-05-02T19:05:40.654Z","etag":null,"topics":["internationalization","languages","laravel","locale","localization","package","php8","translation"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/elaborate-code/laravel-json-tongue","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elaborate-code.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-06T20:15:21.000Z","updated_at":"2022-10-09T07:33:46.000Z","dependencies_parsed_at":"2025-02-07T12:35:05.359Z","dependency_job_id":"0e5a6e8a-ec77-40f9-af6a-f6e5f712615b","html_url":"https://github.com/elaborate-code/laravel-json-tongue","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":"spatie/package-skeleton-laravel","purl":"pkg:github/elaborate-code/laravel-json-tongue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaborate-code%2Flaravel-json-tongue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaborate-code%2Flaravel-json-tongue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaborate-code%2Flaravel-json-tongue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaborate-code%2Flaravel-json-tongue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elaborate-code","download_url":"https://codeload.github.com/elaborate-code/laravel-json-tongue/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaborate-code%2Flaravel-json-tongue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32556771,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T00:31:16.350Z","status":"online","status_checked_at":"2026-05-03T02:00:09.297Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["internationalization","languages","laravel","locale","localization","package","php8","translation"],"created_at":"2024-12-14T12:15:06.313Z","updated_at":"2026-05-03T02:41:54.004Z","avatar_url":"https://github.com/elaborate-code.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel JSON tongue\n\n[![Latest Version on Packagist](https://img.shields.io/packagist/v/elaborate-code/laravel-json-tongue.svg?style=flat-square)](https://packagist.org/packages/elaborate-code/laravel-json-tongue)\n[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/elaborate-code/laravel-json-tongue/run-tests.yml?branch=main)](https://github.com/elaborate-code/laravel-json-tongue/actions?query=workflow%3Arun-tests+branch%3Amain)\n[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/elaborate-code/laravel-json-tongue/fix-php-code-style-issues.yml?branch=main)](https://github.com/elaborate-code/laravel-json-tongue/actions?query=workflow%3A\"Fix+PHP+code+style+issues\"+branch%3Amain)\n[![Total Downloads](https://img.shields.io/packagist/dt/elaborate-code/laravel-json-tongue.svg?style=flat-square)](https://packagist.org/packages/elaborate-code/laravel-json-tongue)\n![maintained](https://img.shields.io/maintenance/yes/2023)\n![Production ready](https://img.shields.io/badge/Production%20ready-no-red)\n\nThis 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.\n\n## Introduction\n\nStarting with Laravel docs:\n\n\u003e 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.\n\n[Read more...](https://laravel.com/docs/9.x/localization#using-translation-strings-as-keys)\n\nIntuitively, 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.\n\n## Installation\n\nInstall the package via composer:\n\n```bash\ncomposer require elaborate-code/laravel-json-tongue\n```\n\n### Requirements\n\n-   PHP 8.0 or higher.\n\n## Usage\n\nFile structure example:\n\n![example](https://raw.githubusercontent.com/elaborate-code/php-json-tongue/main/illustration.png)\n\n\u003e The JSON files can co-exist with the PHP files without any conflicts!\n\n### The merge command\n\nThis command loads all the JSON files from `/\u003clocale\u003e` folders within the `/lang` folder and merge them per **locale** in new JSON files.\n\n```bash\nphp artisan json-tongue:merge\n```\n\nOptions:\n\n| Option        | Description                                                                           |\n| ------------- | ------------------------------------------------------------------------------------- |\n| `-F\\|--force` | Removes JSON files that already exist in the root of the `lang` folder without asking |\n\n\u003e 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.\n\u003e\n\u003e ⚠️ In the second case be careful before instructing the command to remove existing JSON files!\n\n#### Example\n\nBefore merging :\n\n```txt\n lang\n ┣ 📂es\n ┃ ┣ 📜animals.json\n ┃ ┣ 📜greetings.json\n ┃ ┗ 📜jobs.json\n ┗ 📂fr\n   ┣ 📜animals.json\n   ┣ 📜greetings.json\n   ┗ 📜jobs.json\n```\n\nAfter merging:\n\n```txt\n lang\n ┣ 📂es\n ┃ ┣ 📜animals.json\n ┃ ┣ 📜greetings.json\n ┃ ┗ 📜jobs.json\n ┣ 📂fr\n ┃ ┣ 📜animals.json\n ┃ ┣ 📜greetings.json\n ┃ ┗ 📜jobs.json\n ┣ 📜es.json  ⭐ Usable by Laravel\n ┗ 📜fr.json  ⭐ Usable by Laravel\n```\n\n## Testing\n\n```bash\n./vendor/bin/pest\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Contributing\n\nPlease see [CONTRIBUTING](CONTRIBUTING.md) for details.\n\nHelp needed to add a watch command that refreshes the output JSON files with new translations added on the locale folders.\n\n## Credits\n\n-   [medilies](https://github.com/medilies)\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felaborate-code%2Flaravel-json-tongue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felaborate-code%2Flaravel-json-tongue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felaborate-code%2Flaravel-json-tongue/lists"}