Translate Files Automatically using Laravel Google Translate

In this article, we are going to share how to use google translate package in laravel to translate files automatically. Laravel Google Translate is a package that provides an artisan console command to translate your localization files with the Google translation API.

Laravel Google Translate is a good Laravel package that we can use to translate our files to other languages automatically using stichoza/google-translate-php or Google Translate API.

Installation

composer require tanmuhittin/laravel-google-translate
php artisan vendor:publish --provider="Tanmuhittin\LaravelGoogleTranslate\LaravelGoogleTranslateServiceProvider"

If you would like to use stichoza/google-translate-php you do not need an API key. If you would like to use Google Translate API, edit config/laravel_google_translate.php and add your Google Translate API key.

php artisan config:cache

Then you can run

php artisan translate:files

Hope its work for you.

Leave a Comment