PHPackages                             subotkevic/laravel-json-translation-helper - 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. subotkevic/laravel-json-translation-helper

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

subotkevic/laravel-json-translation-helper
==========================================

Searches for translation keys – inserts into JSON translation files.

v0.2.1(7y ago)1613.8k—4.6%6[1 PRs](https://github.com/subotkevic/laravel-json-translation-helper/pulls)MITPHPPHP &gt;=7.0.0

Since Oct 13Pushed 3y ago2 watchersCompare

[ Source](https://github.com/subotkevic/laravel-json-translation-helper)[ Packagist](https://packagist.org/packages/subotkevic/laravel-json-translation-helper)[ RSS](/packages/subotkevic-laravel-json-translation-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/8bf394529e77964d0f7060fdd6974aa27226d27c529c4edc73993b42c2284b12/68747470733a2f2f706f7365722e707567782e6f72672f7375626f746b657669632f6c61726176656c2d6a736f6e2d7472616e736c6174696f6e2d68656c7065722f642f746f74616c2e737667)](https://packagist.org/packages/subotkevic/laravel-json-translation-helper)[![Latest Stable Version](https://camo.githubusercontent.com/a7e7372a1fdae67bd733e39e366aedd951621829359ac9d14651a4c69f817c74/68747470733a2f2f706f7365722e707567782e6f72672f7375626f746b657669632f6c61726176656c2d6a736f6e2d7472616e736c6174696f6e2d68656c7065722f762f737461626c652e737667)](https://packagist.org/packages/subotkevic/laravel-json-translation-helper)[![License](https://camo.githubusercontent.com/fda66743d4b1e09a5e58c5276a2fcedb81f80501efbd33efdf81f78d7010acf7/68747470733a2f2f706f7365722e707567782e6f72672f7375626f746b657669632f6c61726176656c2d6a736f6e2d7472616e736c6174696f6e2d68656c7065722f6c6963656e73652e737667)](https://packagist.org/packages/subotkevic/laravel-json-translation-helper)

JSON Translation Helper for Laravel
===================================

[](#json-translation-helper-for-laravel)

JSON Translation Helper scans your project for `__()`, `lang()` translation helper methods and `@lang` directives, then it creates keys in your JSON translation files.

And yes, it avoids duplicates – helper creates only non-existing keys. Ready for your translation.

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

[](#installation)

First, install JSON Translation Helper using the Composer require command:

```
composer require subotkevic/laravel-json-translation-helper

```

That's it. Package registers service provider automatically.

Usage
-----

[](#usage)

### Translation files

[](#translation-files)

First, you have to create your translation files for languages you will translate your application to.

For example, if you want your application to have a Spanish translation, you should create a `resources/lang/es.json` file.

Of course you can have multiple translation files:

```
resources/
    lang/
        es.json
        fr.json

```

Make sure that your translation files is valid JSON, otherwise our package will not work:

```
{
    "I love programming.": "Me encanta programar."
}
```

If you don't have any translations for now, just **make sure your file is not empty**, but actually an empty JSON object:

```
{}
```

### Scan your application

[](#scan-your-application)

Finally, to scan your application for missing translation keys just run:

```
php artisan translation:scan

```

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

[](#configuration)

### Publishing configuration

[](#publishing-configuration)

First, publish the configuration file:

```
php artisan vendor:publish --provider="JsonTranslationHelper\TranslationHelperServiceProvider"

```

It will bring you `config/translation-helper.php` configuration file.

Read the following sections of what you can configure.

### Directories

[](#directories)

To specify where you want to scan for translation strings, just modify `scan_directories` array:

```
/**
 * Directories to scan for missing translation keys.
 */
'scan_directories' => [
    app_path(),
    resource_path('views'),
    resource_path('assets'),
],
```

### File extensions

[](#file-extensions)

Our package scans only `.php` files out of the box.

You can add more file extensions to `file_extensions` array in the `config/translation-helper.php` configuration file to scan, let's say, `.vue` or `.js` files:

```
/**
 * File extensions to scan from.
 */
'file_extensions' => [
    'php',
    'js',
    'vue',
],
```

### Translation helper methods

[](#translation-helper-methods)

By default our package looks for `lang()` and `__()` translation helper methods and directives.

But you can extend, modify, or remove them in the config file by modifying `translation_methods` array:

```
/**
 * Translation helper methods to scan
 * for in your application's code.
 */
'translation_methods' => [
    'lang',
    '__',
],
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

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 ~8 days

Total

4

Last Release

2744d ago

### Community

Maintainers

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

---

Top Contributors

[![subotkevic](https://avatars.githubusercontent.com/u/2277261?v=4)](https://github.com/subotkevic "subotkevic (18 commits)")

---

Tags

jsonlaravellaravel-json-translationlaravel-localizationlaravel-packagelaravel-translationlocalizationtranslation-manager

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/subotkevic-laravel-json-translation-helper/health.svg)

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

###  Alternatives

[mcamara/laravel-localization

Easy localization for Laravel

3.5k9.1M112](/packages/mcamara-laravel-localization)[typicms/base

A modular multilingual CMS built with Laravel, enabling developers to manage structured content like pages, news, events, and more.

1.6k20.3k](/packages/typicms-base)[vemcogroup/laravel-translation

Translation package for Laravel to scan for localisations and up/download to poeditor

135304.0k2](/packages/vemcogroup-laravel-translation)

PHPackages © 2026

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