PHPackages                             nawrasbukhari/translation-scanner - 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. nawrasbukhari/translation-scanner

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

nawrasbukhari/translation-scanner
=================================

Searches for translation keys – inserts into JSON translation files.

v1.0.5(1y ago)0519↓33.3%1MITPHPPHP ^8.0

Since Feb 9Pushed 1y agoCompare

[ Source](https://github.com/NawrasBukhari/laravel-translate-scanner)[ Packagist](https://packagist.org/packages/nawrasbukhari/translation-scanner)[ RSS](/packages/nawrasbukhari-translation-scanner/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (3)Versions (7)Used By (0)

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 nawrasbukhari/translation-scanner --dev

```

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 `lang/es.json` file.

Of course, you can have multiple translation files:

```
lang/
    es.json
    fr.json
    en.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="NawrasBukhariTranslationScanner\TranslationScannerServiceProvider"

```

It will bring you `config/translation-scanner.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')
],
```

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

34

—

LowBetter than 77% of packages

Maintenance47

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 69.2% 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 ~159 days

Recently: every ~192 days

Total

6

Last Release

392d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.4.0

1.0.1PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/29cbb8c2f17378feaa5074e50a33b24d2ea2b41bf4f05d5bcf7af9e9e0561d54?d=identicon)[nbukhari](/maintainers/nbukhari)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/nawrasbukhari-translation-scanner/health.svg)

```
[![Health](https://phpackages.com/badges/nawrasbukhari-translation-scanner/health.svg)](https://phpackages.com/packages/nawrasbukhari-translation-scanner)
```

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