Laravel Translation Scanner

Packages

December 4th, 2019

laravel-translation-uploader.png

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:

1php 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:

1# Upload
2php artisan translation:upload
3
4# Scan the codebase and then upload
5php artisan translation:upload --scan
6
7# Download translation languages
8php artisan translation:download

Finally, you can even create public JavaScript translations files that are available on window.i18n with:

1php 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.

Filed in:

Paul Redmond

Full stack web developer. Author of Lumen Programming Guide and Docker for PHP Developers.