boblarouche / traduction
Traduction
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/boblarouche/traduction
Requires
- php: >=7.3
- laravel/framework: ^8.9
Requires (Dev)
- phpunit/phpunit: ^9.3
README
This package copies Laravel translation entries of default language located in resources/lang/xx to a new target language. By default, it adds missing target keys only, but it can also replace everything. Different outputs and a sort option are available.
Installation
You can install the package via composer:
composer require boblarouche/traduction
This package uses your app's fallback_locale configured at config/app.php as the default language.
Usage
php artisan translation:missing
Here are different examples with optional parameters:
php artisan translation:missing --target=fr --output=key php artisan translation:missing --target=es --output=value --replace php artisan translation:missing --target=it --output=value --replace --sort
Options
If no options are specify, the artisan command will prompt the user in terminal. Add target and output options to skip all prompts.
- Target language
--target=fr[no default] - Output type:
--output=valuewill copy default language text for each new entry of target language and--output=keywill use the keys as text. [value is default] - Replace all
--replacewill overwrite any existing translation in target language. Beware: This is Destructive! [false is default] - Sorting
--sortwill put all target keys in aphabetical order [false is default]
Changelog
Please see CHANGELOG for more information what has changed recently.
Future updates/TODO:
- Add auto-translation from external service output e.g. --output=google-translate.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.