amgrade / laravel-js-translations
将翻译提取到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
轻松将Laravel翻译导出到JavaScript。
安装
composer require amgrade/laravel-js-translations
然后,如果您不使用Laravel包自动发现功能,您需要将 JsTranslationServiceProvider
添加到 config/app.php
。
/* * Package Service Providers... */ AMgrade\JsTranslations\JsTranslationServiceProvider::class,
配置
您可以根据需要声明多个束(bundle),并使用不同的选项。例如,当您想将翻译分为管理部分和客户端部分时,只需传递 php artisan js-translations:extract --bundle=admin
和 php artisan js-translations:extract --bundle=client
。有关详细配置,请参阅配置文件。
使用方法
只需运行 php artisan js-translations:extract
。