amgrade/laravel-js-translations

Extract translations into JS

1.0.1 2024-02-29 13:24 UTC

This package is auto-updated.

Last update: 2024-04-29 13:48:28 UTC


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.