Laravel Translation Scanner
Published on by Paul Redmond
The vemcogroup/laravel-translation package by Henrik B Hansen scans your applications for translations and creates your translation JSON files.
The app also has a configuration property for a poeditor API key and project ID, which allows you to upload/download poeditor features.
To use this package, once installed, you run the provided artisan command to scan the project:
php artisan translation:scan
The command creates a base_language.json
file in the resources/lang
directory.
To work with poeditor, you can run the following commands in your app:
# Uploadphp artisan translation:upload # Scan the codebase and then uploadphp artisan translation:upload --scan # Download translation languagesphp artisan translation:download
Finally, you can even create public JavaScript translations files that are available on window.i18n
with:
php artisan translation:create-js
You can learn more about this package, get full installation instructions, and view the source code on GitHub at vemcogroup/laravel-translation.