Downloads
Stars
Version
Install the package via composer:
composer require yaroslawww/laravel-i18n-strings-batch
As usually js strings has other formatting for choise
and others - you will want set all js strings to specific
directory and call batches without specify directory each time:
use I18nStringsBatch\I18nStringsBatchManager;
class AppServiceProvider extends ServiceProvider
{
public function register()
{
I18nStringsBatchManager::setDefaultDirectoryPrefix('front-js');
}
}
\I18nStringsBatch\Facades\I18nStringsBatch::getBatch(["licenses-list", "modal-confirmation"]);
\I18nStringsBatch\Facades\I18nStringsBatch::getBatchJson(["licenses-list", "modal-confirmation"]);
// or
\I18nStringsBatch\Facades\I18nStringsBatch::getBatch("modal-confirmation");
\I18nStringsBatch\Facades\I18nStringsBatch::getBatchJson("modal-confirmation");
// Using helpers
i18n_strings_batch(["licenses-list", "modal-confirmation"])
i18n_strings_batch_json(["licenses-list", "modal-confirmation"])
// or
i18n_strings_batch("modal-confirmation")
i18n_strings_batch_json("modal-confirmation")
<licenses-list
:i18n-batch='@transBatch("licenses-list")'
/>
<!-- or -->
<licenses-list
:i18n-batch='@transBatch(["licenses-list", "modal-confirmation"])'
/>
Optionally publish assets
php artisan vendor:publish --tag=i18n-string-batch-resources --force
Example you can find there
transBatch
<?php echo i18n_strings_batch_json(
); ?>