
Extract Untranslated Strings from Laravel Projects
Localizator is a small tool for Laravel that gives you the ability to extract untranslated strings from project files. It works using the artisan command line and the provided localize
command:
php artisan localize de,fr
The above command will create a de.json
and fr.json
file in the resources/lang
folder or add missing keys if these files already exist.
You can also use the configuration value in app.locale
by running the command without arguments:
# Use the `config('app.locale')` value
php artisan localize
The package also provides configurable values to suit your project’s needs, along with sensible defaults:
return [
/**
* Search criteria for files.
*/
'search' => [
/**
* Directories which should be looked inside.
*/
'dirs' => ['resources/views'],
/**
* Patterns by which files should be queried.
* The values can be a regular expresion, glob, or just a string.
*/
'patterns' => ['*.php'],
/**
* Functions that the strings will be extracted from.
* Add here any custom defined functions.
* NOTE: The translation string should always be the first argument.
*/
'functions' => ['__', 'trans', '@lang']
],
/**
* Should the localize command sort extracted strings alphabetically?
*/
'sort' => true,
];
You can learn more about this package, get full installation instructions, and view the source code on GitHub.
Filed in: Laravel Packages / packagesNewsletter

Join 31,000+ others and never miss out on new tips, tutorials, and more.
Laravel Jobs

- Software Developer
-
Remote (US & Canada)
Alley - 😎 Laravel Developer
-
Remote
Jogg, Inc - Junior, Mid, and Senior Software Engineers. Laravel / Vue. Saint Petersburg, FL
-
Saint Petersburg, FL and Remote
ShineOn - Senior PHP Developer (Laravel)
-
Remote
The Interaction Design Foundation - Fullstack Laravel Engineer (Munich/Remote) 💻
-
Munich, Germany or Remote
AirLST GmbH
Envault, a secure .env sharing tool for your team, just launched v2
Envault is a tool to share .env secrets. It lets you manage and sync your entire team’s local .env files, across all…
Laravel Snippet #25: Ecosystem Discussion, Auth Recap, Passport, Sanctum
Taylor just released his latest episode on the Laravel Snippet podcast and he talks about some recent comments regard…