PHPackages                             therichardw/translate-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. therichardw/translate-scanner

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

therichardw/translate-scanner
=============================

Translatable String Exporter for Laravel without double escapes

07PHP

Since Sep 12Pushed 3y agoCompare

[ Source](https://github.com/TheRichardW/translate-scanner)[ Packagist](https://packagist.org/packages/therichardw/translate-scanner)[ RSS](/packages/therichardw-translate-scanner/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

This Package is Based of Translatable String Exporter for Laravel From kkomelin
===============================================================================

[](#this-package-is-based-of-translatable-string-exporter-for-laravel-from-kkomelin)

Since Laravel 5.4, you can use `__('Translate me')` or `@lang('Translate me')` with translations in JSON files to translate strings. Translatable String Exporter is aimed to collect all translatable strings of an application and create corresponding translation files in JSON format to simplify the process of translation.

Versions
--------

[](#versions)

PackagePHP`1.15.1``^7.2|^8.0`*Even though we drop support for PHP versions in minor releases, Composer ensures that users with previous versions of PHP don't get not-yet-supported PHP code.*

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

[](#installation)

*Normally, it's enough to install the package as a development dependency.*

```
composer require therichardw/translate-scanner --dev
```

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

[](#configuration)

To change [project defaults](https://github.com/kkomelin/laravel-translatable-string-exporter/wiki/Configuration-and-Project-Defaults), use the following command to create a configuration file in your `config` folder and make necessary changes in there:

```
php artisan vendor:publish --provider="TheRichardW\TranslateScanner\Providers\ExporterServiceProvider"
```

Usage
-----

[](#usage)

### Export translatable strings

[](#export-translatable-strings)

```
php artisan translatable:export
```

Where `` is a language code or a comma-separated list of language codes.
For example:

```
php artisan translatable:export es
php artisan translatable:export es,bg,de
```

The command with the "es,bg,de" parameter passed will create es.json, bg.json, de.json files with translatable strings or update the existing files in the `resources/lang` folder of your project.

### Find untranslated strings in a language file (command)

[](#find-untranslated-strings-in-a-language-file-command)

To inspect an existing language file (find untranslated strings), use this command:

```
php artisan translatable:inspect-translations fr
```

Only one language at a time, please.

To export translatable strings for a language and then inspect translations in it, use the following command:

```
php artisan translatable:inspect-translations fr --export-first
```

### Find untranslated strings in a language file (IDE)

[](#find-untranslated-strings-in-a-language-file-ide)

An alternative way to find untranslated strings in your language files is to search for entries with the same string for original and translated. You can do this in most editors using a regular expression.

In PhpStorm, you can use this pattern: `"([^"]*)": "\1"`

### Persistent strings

[](#persistent-strings)

Some strings are not included in the export, because they are being dynamically generated. For example:

`{{ __(sprintf('Dear customer, your order has been %s', $orderStatus)) }}`

Where `$orderStatus` can be 'approved', 'paid', 'cancelled' and so on.

In this case, you can add the strings to the `.json` file manually. For example:

```
  "Dear customer, your order has been approved": "Dear customer, your order has been approved",
  "Dear customer, your order has been paid": "Dear customer, your order has been paid",
  ...

```

In order for those, manually added, strings not to get removed the next time you run the export command, you should add them to a json file named `persistent-strings.json`. For example:

```
[
  "Dear customer, your order has been approved",
  "Dear customer, your order has been paid",
  ...
]

```

License &amp; Copyright
-----------------------

[](#license--copyright)

[MIT](https://github.com/kkomelin/laravel-translatable-string-exporter/blob/master/LICENSE), (c) 2017 Konstantin Komelin and [contributors](https://github.com/kkomelin/laravel-translatable-string-exporter/graphs/contributors)

###  Health Score

16

—

LowBetter than 4% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 79.3% 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.

### Community

Maintainers

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

---

Top Contributors

[![kkomelin](https://avatars.githubusercontent.com/u/755066?v=4)](https://github.com/kkomelin "kkomelin (180 commits)")[![t1sh0o](https://avatars.githubusercontent.com/u/3911728?v=4)](https://github.com/t1sh0o "t1sh0o (11 commits)")[![phh](https://avatars.githubusercontent.com/u/1304003?v=4)](https://github.com/phh "phh (11 commits)")[![TheRichardW](https://avatars.githubusercontent.com/u/99175545?v=4)](https://github.com/TheRichardW "TheRichardW (6 commits)")[![kohlerdominik](https://avatars.githubusercontent.com/u/18621527?v=4)](https://github.com/kohlerdominik "kohlerdominik (5 commits)")[![remcom](https://avatars.githubusercontent.com/u/3468852?v=4)](https://github.com/remcom "remcom (4 commits)")[![Hannoma](https://avatars.githubusercontent.com/u/7955676?v=4)](https://github.com/Hannoma "Hannoma (2 commits)")[![dacoto](https://avatars.githubusercontent.com/u/16915053?v=4)](https://github.com/dacoto "dacoto (2 commits)")[![mabdelrahman91](https://avatars.githubusercontent.com/u/64133759?v=4)](https://github.com/mabdelrahman91 "mabdelrahman91 (2 commits)")[![tommyschmiedel](https://avatars.githubusercontent.com/u/3260816?v=4)](https://github.com/tommyschmiedel "tommyschmiedel (1 commits)")[![efriandika](https://avatars.githubusercontent.com/u/6255825?v=4)](https://github.com/efriandika "efriandika (1 commits)")[![taoufiqaitali](https://avatars.githubusercontent.com/u/22837086?v=4)](https://github.com/taoufiqaitali "taoufiqaitali (1 commits)")[![Blair2004](https://avatars.githubusercontent.com/u/5265663?v=4)](https://github.com/Blair2004 "Blair2004 (1 commits)")

### Embed Badge

![Health badge](/badges/therichardw-translate-scanner/health.svg)

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

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