PHPackages                             aavinseth/laravel-translate - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. aavinseth/laravel-translate

ActiveLibrary[Localization &amp; i18n](/categories/localization)

aavinseth/laravel-translate
===========================

Automatically translate your Laravel language files using Google Translate or DeepL

1.0(1mo ago)04MITPHPPHP ^8.2CI failing

Since Jun 9Pushed 1mo agoCompare

[ Source](https://github.com/aavinseth/laravel-translate)[ Packagist](https://packagist.org/packages/aavinseth/laravel-translate)[ Docs](https://github.com/aavinseth/laravel-translate)[ RSS](/packages/aavinseth-laravel-translate/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (11)Versions (2)Used By (0)

Laravel Translate
=================

[](#laravel-translate)

[![Latest Version](https://camo.githubusercontent.com/08ec6883104cc1a98a4db780c7c1efd8270346651d7eb63780b15cd7ed9d8e6a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f616176696e736574682f6c61726176656c2d7472616e736c6174652e7376673f7374796c653d666c61742d737175617265)](https://github.com/aavinseth/laravel-translate/releases)[![License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

With this package you can translate your language files using a translator service. The package ships with a free Google Translate version, the Google Cloud Translate API and DeepL.

Specify a source language and a target language and it will automatically translate your files. This is useful if you want to prototype something quickly or just get a first idea of the translation for later editing. The package ships with two artisan commands. One for translating all the missing translations that are set in the source language but not in the target language. The other one for translating all source language files and overwriting everything in the target language.

> This package is a maintained fork of [`ben182/laravel-auto-translate`](https://github.com/ben182/laravel-auto-translate), updated to support Laravel 11, 12 and 13 on PHP 8.2+. The abandoned `themsaid/laravel-langman` dependency has been vendored into the package.

Installation
------------

[](#installation)

This package supports **Laravel 11, 12 and 13** and needs **PHP 8.2 or higher** (PHP 8.3+ is required when running on Laravel 13).

You can install the package via composer:

```
composer require aavinseth/laravel-translate
```

The free Google Translate translator works out of the box. To use the other translators, install their (optional) dependencies:

```
# Google Cloud Translate (simple API key based, V2 client)
composer require google/cloud-translate:^1.18

# DeepL (requires a PSR-18 HTTP client such as Guzzle)
composer require scn/deepl-api-connector:^4.0 guzzlehttp/guzzle:^7.8 php-http/discovery
```

Config
------

[](#config)

After installation publish the config file:

```
php artisan vendor:publish --provider="Aavinseth\LaravelTranslate\AutoTranslateServiceProvider"
```

You can specify your source language, the target language(s), the translator and the path to your language files in there.

Translators
-----------

[](#translators)

NameFreeFileDocumentationAvailable languagesGoogle Translate HTTPYesAavinseth\\LaravelTranslate\\Translators\\SimpleGoogleTranslator/Over 100Google Cloud TranslateNoAavinseth\\LaravelTranslate\\Translators\\GoogleCloudTranslator[Documentation](https://cloud.google.com/translate/)Over 100DeepL API v2NoAavinseth\\LaravelTranslate\\Translators\\DeeplTranslator[Documentation](https://www.deepl.com/docs-api.html)EN, DE, FR, ES, PT, IT, NL, PL, RUIf you have lots of translations to make I recommend Google Cloud Translate or DeepL. They are fast, reliable and you will not encounter any rate limiting.

Usage
-----

[](#usage)

### Missing translations

[](#missing-translations)

Simply call the artisan missing command for translating all the translations that are set in your source language, but not in your target language:

```
php artisan autotrans:missing
```

E.g. you have English set as your source language. The source language has translations in auth.php:

```
