amgrade / laravel-js-translations
Extract translations into JS
1.0.1
2024-02-29 13:24 UTC
Requires
- illuminate/console: ^9.0 || ^10.0
- illuminate/support: ^9.0 || ^10.0
- symfony/finder: ^6.0
README
Easy way to export Laravel translations to JavaScript.
Installation
composer require amgrade/laravel-js-translations
Then, if you don't use Laravel package autodiscovery feature, you need to add
JsTranslationServiceProvider
to the config/app.php
.
/* * Package Service Providers... */ AMgrade\JsTranslations\JsTranslationServiceProvider::class,
Configuration
You can declare as many bundles as you wish with different options.
For example, when you want to split your translations for admin part and client side part.
Then just pass php artisan js-translations:extract --bundle=admin
and php artisan js-translations:extract --bundle=client
.
For detailed configurations, please review config file.
Usage
Just run php artisan js-translations:extract
.