mineschan / loco-laravel-export
Export strings and translations from https://localise.biz for Laravel 5 projects
Requires
- chumper/zipper: 1.0.x
- illuminate/support: ~5
- loco/loco: ^2.0
Requires (Dev)
- mockery/mockery: ^1.1
- orchestra/testbench: ~3.0
- phpunit/phpunit: ~7.0
- sempro/phpunit-pretty-print: ^1.0
This package is auto-updated.
Last update: 2024-10-22 12:02:51 UTC
README
A drop in solution for exporting translations from https://localise.biz - A translation management tool to Laravel 5 project.
Installation
Via Composer
$ composer require mineschan/loco-laravel-export
If you like to have custom configurations
$ php artisan vendor:publish --provider="mineschan\LocoLaravelExport\LocoLaravelExportServiceProvider"
Usage: Export
Step 1
Add your Export Key as LOCO_EXPORT_API_KEY
in .env
Step 2
Save all available languages to resources/lang directory.
$ php artisan localise:export
Done!
By default the package export all available languages from your Loco porjects, if you like to export only part of them you can specify using arguments.
$ php artisan localise:export en zh-Hants
You can pass them one by one, or you can simply pass zh
for all zh
locale. e.g. zh-Hant
, zh-TW
Export in Live servers
Just like artisan:migrate
. If you run localise:export
on non-local environment, confirmation will be needed.
You can pass -f
or --force
to make it silent. Helpful if you want to include this to your CI/CD flow.
$ php artisan localise:export -f
Usage: Get string
LocoLaravelExport saves string array files from Localise.biz to resources/lang/{lang}/loco.php
by default.
This package provides a helper function loco()
to help you retrieve your saved strings with this package easily.
loco('your_key');
Alternatively, you can still use Laravel __()
helper like so __('loco.{your_string_key}')
.
Configurable options
Contributions
Pull request is welcomed!
This is my first composer package, please do support me by giving me stars.
Change log
Please see the changelog for more information on what has changed recently.
Author
License
MIT. Please see the license file for more information.