testmonitor / laravel-vue-i18n-generator
This package compiles your Laravel translation files into a Vue i18n compatible JSON file.
Installs: 1 417
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 3
Open Issues: 0
Requires
- php: ^8.1
- illuminate/support: ^10.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.1
- orchestra/testbench: ^8.5
- phpunit/phpunit: ^10.0
- squizlabs/php_codesniffer: ^3.5.2
README
This package compiles your Laravel translation files into a Vue i18n compatible Javascript file.
Table of Contents
Installation
Start by installing the package using Composer:
$ composer require testmonitor/laravel-vue-i18n-generator
Optionally publish the package assets:
$ php artisan vendor:publish --provider="TestMonitor\VueI18nGenerator\VueI18nGeneratorServiceProvider" --tag="config"
You're all set up now!
Usage
When installed, use the Artisan command to generate the Vue i18n file:
$ php artisan vue:translations
This compiles your Laravel JSON and PHP language files into a single Javascript file
called vue-i18n-locales.js
located in /resources/js/i18n
.
By default, your Laravel language path is used to determine which files to include. You can override this behavior using the path option:
$ php artisan vue:translations --path=resources/lang
There is also an option to change the output file path:
$ php artisan vue:translations --output=resources/js/i18n.js
Alternatively, you can configure output file path in the configuration file.
Changelog
Refer to CHANGELOG for more information.
Contributing
Refer to CONTRIBUTING for contributing details.
Credits
- Thijs Kok - Lead developer - ThijsKok
- Stephan Grootveld - Developer - Stefanius
- Frank Keulen - Developer - FrankIsGek
License
The MIT License (MIT). Refer to the License for more information.