New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel
1,998,172 331

Larablocks Analysis

kkomelin/laravel-translatable-string-exporter works with Laravel 8 to 13 (latest release 1.26.0, Mar 18, 2026).

Laravel 5, 6 and 7 in earlier releases.

Recommendation checks

Recommended

Recommended by Larablocks: meets all 4 checks.

  • Works with Laravel 13, the current version
  • Released in the last 12 months (Mar 18, 2026)
  • 153,372 downloads a month (at least 10,000)
  • 331 GitHub stars (at least 100)

State

Maintained
  • Last stable release: Mar 18, 2026.
  • 1 release in the last 12 months.
  • First released: Apr 22, 2017.
  • Monthly downloads: 153,372, up 245% from six months ago.
  • 1 open issue on GitHub.

Data from Packagist and GitHub, checked by Larablocks on Dec 3, 2026.

Install
composer require kkomelin/laravel-translatable-string-exporter
Latest Version:1.26.0
PHP:^8.2
Laravel:8 – 13
Older releases:5 · 6 · 7
License:MIT
Last Updated:Mar 18, 2026
Links: GitHub  ·  Packagist
Maintainer: kkomelin

Translatable String Exporter for Laravel

Tests Status Badge PHPStan Status Badge Code Styles Check Badge

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

Package PHP
<=1.15.1 5.6
>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

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

composer require kkomelin/laravel-translatable-string-exporter --dev

Configuration

To change 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

Export translatable strings

php artisan translatable:export <lang>

Where <lang> 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)

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)

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

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 <lang>.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",
  ...
]

MIT, (c) 2017-present Konstantin Komelin and contributors

Alternatives to kkomelin/laravel-translatable-string-exporter

laravel-lang/publisher

Localization publisher for your Laravel application

13,144,130 217
kg-bot/laravel-localization-to-vue

Laravel package used to collect all localization files from resources/lang (and...

1,030,863 238
tio/laravel

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

382,573 169
kenepa/translation-manager

Manage your application's translation strings in Filament.

123,777 147
lukasss93/laravel-larex

Translate your Laravel application from a single CSV file!

128,016 98

Version History

Version Released PHP Laravel License
1.26.0 ^8.2 ^8|^9|^10.0|^11.0|^12.0|^13.0 MIT
1.25.0 ^8.0 ^8|^9|^10.0|^11.0|^12.0 MIT
1.24.0 ^8.0 ^8|^9|^10.0|^11.0|^12.0 MIT
1.23.0 ^8.0 ^8|^9|^10.0|^11.0|^12.0 MIT
1.22.0 ^8.0 ^8|^9|^10.0|^11.0 MIT