PHPackages                             kkomelin/laravel-translatable-string-exporter - 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. kkomelin/laravel-translatable-string-exporter

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

kkomelin/laravel-translatable-string-exporter
=============================================

Translatable String Exporter for Laravel

1.26.0(2mo ago)3291.4M—9.1%44[1 PRs](https://github.com/kkomelin/laravel-translatable-string-exporter/pulls)9MITPHPPHP ^8.2CI passing

Since Apr 22Pushed 2mo ago6 watchersCompare

[ Source](https://github.com/kkomelin/laravel-translatable-string-exporter)[ Packagist](https://packagist.org/packages/kkomelin/laravel-translatable-string-exporter)[ Fund](https://www.buymeacoffee.com/kkomelin)[ GitHub Sponsors](https://github.com/kkomelin)[ RSS](/packages/kkomelin-laravel-translatable-string-exporter/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (39)Used By (9)

Translatable String Exporter for Laravel
========================================

[](#translatable-string-exporter-for-laravel)

[![Tests Status Badge](https://github.com/kkomelin/laravel-translatable-string-exporter/actions/workflows/run-tests.yml/badge.svg)](https://github.com/kkomelin/laravel-translatable-string-exporter/actions/workflows/run-tests.yml)[![PHPStan Status Badge](https://github.com/kkomelin/laravel-translatable-string-exporter/actions/workflows/phpstan.yml/badge.svg)](https://github.com/kkomelin/laravel-translatable-string-exporter/actions/workflows/phpstan.yml)[![Code Styles Check Badge](https://github.com/kkomelin/laravel-translatable-string-exporter/actions/workflows/php-cs-fixer.yml/badge.svg)](https://github.com/kkomelin/laravel-translatable-string-exporter/actions/workflows/php-cs-fixer.yml)

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``>1.18.0``^8.0``>1.25.0``^8.2`*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 kkomelin/laravel-translatable-string-exporter --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="KKomelin\TranslatableStringExporter\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 `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
```

The command only supports inspecting one language at a time.

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 and VSCode, 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-present Konstantin Komelin and [contributors](https://github.com/kkomelin/laravel-translatable-string-exporter/graphs/contributors)

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance88

Actively maintained with recent releases

Popularity60

Solid adoption and visibility

Community34

Small or concentrated contributor base

Maturity88

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 74.8% 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 ~87 days

Recently: every ~183 days

Total

38

Last Release

61d ago

Major Versions

0.5.0 → 1.0.02018-11-25

PHP version history (4 changes)0.1.0PHP &gt;=5.4.0

1.16.0PHP ^7.2|^8.0

1.18.0PHP ^8.0

1.26.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/43b36b7cd183e67f8655b4552915a56d9000db8bcbfb1b644a44c29707323805?d=identicon)[kkomelin](/maintainers/kkomelin)

---

Top Contributors

[![kkomelin](https://avatars.githubusercontent.com/u/755066?v=4)](https://github.com/kkomelin "kkomelin (214 commits)")[![wilsenhc](https://avatars.githubusercontent.com/u/13445515?v=4)](https://github.com/wilsenhc "wilsenhc (13 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)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (8 commits)")[![G3z](https://avatars.githubusercontent.com/u/875086?v=4)](https://github.com/G3z "G3z (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)")[![joelstein](https://avatars.githubusercontent.com/u/152397?v=4)](https://github.com/joelstein "joelstein (3 commits)")[![mabdelrahman91](https://avatars.githubusercontent.com/u/64133759?v=4)](https://github.com/mabdelrahman91 "mabdelrahman91 (2 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)")[![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)")[![tommyschmiedel](https://avatars.githubusercontent.com/u/3260816?v=4)](https://github.com/tommyschmiedel "tommyschmiedel (1 commits)")[![Blair2004](https://avatars.githubusercontent.com/u/5265663?v=4)](https://github.com/Blair2004 "Blair2004 (1 commits)")[![wel0z](https://avatars.githubusercontent.com/u/6516617?v=4)](https://github.com/wel0z "wel0z (1 commits)")

---

Tags

exportexporterjsonlaravellocalizationtranslationtranslationsjsonlaravellocalizationtranslationstranslationexportexporter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

### Embed Badge

![Health badge](/badges/kkomelin-laravel-translatable-string-exporter/health.svg)

```
[![Health](https://phpackages.com/badges/kkomelin-laravel-translatable-string-exporter/health.svg)](https://phpackages.com/packages/kkomelin-laravel-translatable-string-exporter)
```

###  Alternatives

[barryvdh/laravel-translation-manager

Manage Laravel Translations

1.7k3.6M17](/packages/barryvdh-laravel-translation-manager)[tio/laravel

Add this package to localize your Laravel application (PHP, JSON or GetText).

170318.5k](/packages/tio-laravel)[laravel-lang/locales

Basic functionality for working with localizations

134.5M12](/packages/laravel-lang-locales)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

2770.1k1](/packages/opgginc-codezero-laravel-localized-routes)[andrewdwallo/transmatic

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

5511.6k](/packages/andrewdwallo-transmatic)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

3812.2k](/packages/erag-laravel-lang-sync-inertia)

PHPackages © 2026

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