Download the PHP package faelzanin/translatelang without Composer
On this page you can find all versions of the php package faelzanin/translatelang. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download faelzanin/translatelang
More information about faelzanin/translatelang
Files in faelzanin/translatelang
Package translatelang
Short Description Translate the language files of your project for any language with a simple command.
License MIT
Informations about the package translatelang
TranslateLang
Translate your language files from a Laravel 5.1+ project with a simple command.
Installation
TranslateLang must be installed in the root directory of your app, by composer with command:
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:
Faelzanin\Translatelang\TranslateLangProvider::class
It's all done! After this steps, the Artisan command to translate your files will be available.
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.
To translate your language files, open the console and run the command:
php artisan translate:lang
After running this command will show the following question:
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:
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
If all goes well, it will be shown a success message.
The language file has been successfully translated.
Also, set the language translated file in the folder below:
<app>\
<resources>\
<lang>\
<location>\
Filename.php
Done, simple and practical!