Translations generator for laravel apps.
krzar/laravel-translation-generator is a Laravel package for translations generator for laravel apps..
It currently has 17 GitHub stars and 212 downloads on Packagist (latest version v5.0.0).
Install it with composer require krzar/laravel-translation-generator.
Discover more Laravel packages by krzar
or browse all Laravel packages to compare alternatives.
Last updated
This package allows you to:
| Version | Laravel | PHP | Supported | |---------|-------------|--------------|--------------------| | 5.x | 12.x - 13.x | 8.3 - 8.5 | :white_check_mark: | | 4.x | 11.x - 12.x | 8.2 - 8.5(*) | :white_check_mark: | | 3.x | 10.x - 11.x | 8.1 - 8.3 | :x: | | 2.x | 6.x - 10.x | 8.0 - 8.3 | :x: |
[!NOTE]
*PHP 8.5 is supported for Laravel 12 only
composer require krzar/laravel-translation-generator
[!NOTE] Remember, this package supports Laravel Prompts. So you can skip commands arguments and just answer the questions.
Generate new translation files for es language.
php artisan make:translation es
If the file exists, it will be completed with the missing keys.
Files and keys will be copied based on the fallback locale specified in the app configuration.
You can change fallback locale.
If you have published any translations from other packages the command will ask you if you want to generate new language translations for them as well.
php artisan make:translation es --fallback=de
You can also overwrite all values if file currently exists.
php artisan make:translation es --overwrite
All values will be copied from fallback locale by default. If you want to clear every translation value you can use clear-values option.
php artisan make:translation es --clear-values
This will clear values only for new keys, to clear everything, combine two options.
php artisan make:translation es --clear-values --overwrite
Generate new php translation file for every language.
php artisan make:translation-file common
This will generate new php file common.php in every language folder (except packages translations folders).