anourvalar/laravel-interpreter
Laravel's locales translate through the single (flat) file
6,097
| Install | |
|---|---|
composer require anourvalar/laravel-interpreter |
|
| Latest Version: | 2.11.0 |
| PHP: | ^8.0 |
| License: | MIT |
| Last Updated: | Jun 26, 2026 |
| Links: | GitHub · Packagist |
Maintainer: AnourValar
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 directory lang/en/admin/*
],
"exclude_keys": []
},
"view_files": {
"exclude": [],
"include": [
"/admin/" // include all files (parse phrases) inside directory views/admin/*
]
},
"vendor_view_files": {
"exclude": [],
"include": ["/anourvalar/laravel-form/"] // include all files inside directory vendor/*
},
"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>
Related Packages
brackets/translatable
Make your Eloquent models and other content translated into multiple languages
267,759
8
highsolutions/laravel-lang-import-export
A Laravel package providing artisan commands to import and export language files...
347,276
24
ufirst/lang-import-export
A Laravel package providing artisan commands to import and export language files...
236,966
41
omaralalwi/lexi-translate
Laravel translation package with morph relationships and caching.
26,544
72
cache
database-translations
dynamic-translation
eloquent-translation
i18n
language-switch
languages
laravel
laravel-locales
laravel-multi-language
laravel-translations
lexi-translate
locales
localization
many-languages
many-locales
morph
multi-locales
multi-region
multilanguage
multilingual
polyglot
spatie
spatie translate
text-localization
trans
translate
translation
translation-cache
translation-management
translations
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 2.11.0 | ^8.0 | ^8.0| | MIT | |
| 2.10.17 | ^8.0 | ^8.0| | MIT | |
| 2.10.16 | ^8.0 | ^8.0| | MIT | |
| 2.10.15 | ^8.0 | ^8.0| | MIT | |
| 2.10.14 | ^8.0 | ^8.0| | MIT | |
| 2.10.13 | ^8.0 | ^8.0| | MIT | |
| 2.10.12 | ^8.0 | ^8.0| | MIT | |
| 2.10.11 | ^8.0 | ^8.0| | MIT | |
| 2.10.10 | ^8.0 | ^8.0| | MIT | |
| 2.10.9 | ^8.0 | ^8.0| | MIT | |
| 2.10.8 | ^8.0 | ^8.0| | MIT | |
| 2.10.7 | ^8.0 | ^8.0| | MIT | |
| 2.10.6 | ^8.0 | ^8.0| | MIT | |
| 2.10.5 | ^8.0 | ^8.0| | MIT | |
| 2.10.4 | ^8.0 | ^8.0| | MIT | |
| 2.10.3 | ^8.0 | ^8.0| | MIT | |
| 2.10.2 | ^8.0 | ^8.0| | MIT | |
| 2.10.1 | ^8.0 | ^8.0| | MIT | |
| 2.10.0 | ^8.0 | ^8.0| | MIT | |
| 2.9.3 | ^8.0 | ^8.0| | MIT | |
| 2.9.2 | ^8.0 | ^8.0| | MIT | |
| 2.9.1 | ^8.0 | ^8.0| | MIT | |
| 2.9.0 | ^8.0 | ^8.0| | MIT | |
| 2.8.1 | >=8.0 | >=8.0 | MIT | |
| 2.8.0 | >=8.0 | >=8.0 | MIT | |
| 2.7.2 | >=8.0 | >=8.0 | MIT | |
| 2.7.1 | >=8.0 | >=8.0 | MIT | |
| 2.7.0 | >=8.0 | >=8.0 | MIT | |
| 2.6.1 | >=7.1.0 | >=5.5.0 | MIT | |
| 2.6.0 | >=7.1.0 | >=5.5.0 | MIT |
Showing the latest 30 of 53. See every release on Packagist