faelzanin / translatelang
Translate the language files of your project for any language with a simple command.
Requires
- php: >= 5.5.0
- guzzlehttp/guzzle: ~5.0
- laravel/framework: 5.*
This package is not auto-updated.
Last update: 2025-09-17 14:16:35 UTC
README
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!