laravel-interpreter maintained by anourvalar
Last update
2026/03/22 07:54
License
Require
- php ^8.0
- laravel/framework ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
Last update
2026/03/22 07:54
License
Require
- php ^8.0
- laravel/framework ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
Last update
2026/03/18 17:23
License
Require
- php ^8.0
- laravel/framework ^8.0|^9.0|^10.0|^11.0|^12.0|^13.0
Last update
2026/03/03 16:01
License
Require
- php ^8.0
- laravel/framework ^8.0|^9.0|^10.0|^11.0|^12.0
Last update
2025/08/09 10:23
License
Require
- php ^8.0
- laravel/framework ^8.0|^9.0|^10.0|^11.0|^12.0
Last update
2025/03/02 16:38
License
Require
- php ^8.0
- laravel/framework ^8.0|^9.0|^10.0|^11.0|^12.0
Laravel Interpreter
- Export all untranslated phrases from your project to a single file for a translator.
- Import all translated phrases from a single file to your project's structure.
- Find & wrap text phrases with missed @lang() directive in your blade templates.
Installation
composer require anourvalar/laravel-interpreter --dev
Usage: basic flow
Step #1: Create schema (config) for a target locale
php artisan interpreter:schema ru
Step #2: Fill in the config
{
"source_locale": "en", // reference (source) locale
"target_locale": "ru",
"adapter": "AnourValar\\LaravelInterpreter\\Adapters\\JsonAdapter",
"filename": "ru_i18.json",
"include_json": true, // include phrases from lang/en.json
"lang_files": {
"exclude": [],
"include": [
"/admin/" // include all files inside folder lang/en/admin/*
],
"exclude_keys": []
},
"view_files": {
"exclude": [],
"include": [
"/admin/" // include all files (parse phrases) inside folder views/admin/*
]
},
"exclude_phrases": ["ID", "Email", "E-Mail"],
"include_pattern": null // "white" filter (regexp)
}
Step #3: Export untranslated phrases to a single file for a translator
php artisan interpreter:export ru
This command also display all unwrapped (with missing @lang) phrases.
Step #4: Import the completed single file to the project's structure
php artisan interpreter:import ru
Usage: wrap
php artisan interpreter:wrap resources/views/test.blade.php
Original template
<div>Привет, Мир!</div>
Modified template
<div>@lang('Привет, Мир!')</div>