TranslateLang
Translate your language files from a Laravel 5.1+ project with a simple command., (*1)
Installation
TranslateLang must be installed in the root directory of your app, by composer with command:, (*2)
composer require faelzanin/translatelang
Configuration
After the conclusion of installation process, you must configure the provider of TranslateLang. Open the file config/app.php and add the following line in the array of providers:, (*3)
Faelzanin\Translatelang\TranslateLangProvider::class
It's all done! After this steps, the Artisan command to translate your files will be available., (*4)
Usage
Before running this command, check the existence of a connection to the Internet, because this package uses a Google translator library, to make the translations., (*5)
To translate your language files, open the console and run the command:, (*6)
php artisan translate:lang
After running this command will show the following question:, (*7)
What is the name of the language file you want to translate?
Enter the name of the language file (example: passwords), you want to translate, and press Enter to go to the next step:, (*8)
What is the location you want to be translated ? Example : en | es | pt | ru
Here, you must report to which location the file is translated. For example, to Portuguese, inform the location pt, (*9)
If all goes well, it will be shown a success message., (*10)
The language file has been successfully translated.
Also, set the language translated file in the folder below:, (*11)
<app>\
<resources>\
<lang>\
<location>\
Filename.php
Done, simple and practical!, (*12)