anourvalar / laravel-interpreter
Laravel's locales translate through the single (flat) file
2.10.11
2026-03-03 15:01 UTC
Requires
- php: ^8.0
- laravel/framework: ^8.0|^9.0|^10.0|^11.0|^12.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.26
- phpstan/phpstan: ^2.0
- psalm/plugin-laravel: ^3.0
- squizlabs/php_codesniffer: ^3.7
- dev-master
- 2.10.11
- 2.10.10
- 2.10.9
- 2.10.8
- 2.10.7
- 2.10.6
- 2.10.5
- 2.10.4
- 2.10.3
- 2.10.2
- 2.10.1
- 2.10.0
- 2.9.3
- 2.9.2
- 2.9.1
- 2.9.0
- 2.8.1
- 2.8.0
- 2.7.2
- 2.7.1
- 2.7.0
- 2.6.1
- 2.6.0
- 2.5.0
- 2.4.3
- 2.4.2
- 2.4.1
- 2.4.0
- 2.3.1
- 2.3.0
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.1
- 2.0.0
- 1.3.0
- 1.2.0
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 0.1.1
- 0.1.0
This package is auto-updated.
Last update: 2026-03-03 15:02:44 UTC
README
- 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>