PHPackages                             tanmuhittin/laravel-google-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. tanmuhittin/laravel-google-translate

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

tanmuhittin/laravel-google-translate
====================================

Translate translation files to other languages using google translate api

2.4.2(11mo ago)4312.2M—4.9%73[17 issues](https://github.com/tanmuhittin/laravel-google-translate/issues)[7 PRs](https://github.com/tanmuhittin/laravel-google-translate/pulls)11MITPHPPHP &gt;=8.2

Since Dec 11Pushed 11mo ago10 watchersCompare

[ Source](https://github.com/tanmuhittin/laravel-google-translate)[ Packagist](https://packagist.org/packages/tanmuhittin/laravel-google-translate)[ Patreon](https://www.patreon.com/tanmuhittin)[ RSS](/packages/tanmuhittin-laravel-google-translate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (29)Used By (11)

laravel-google-translate
========================

[](#laravel-google-translate)

- Translate translation files (under /resources/lang) or lang.json files
- Provide extra facade functions Str::apiTranslate and Str::apiTranslateWithAttributes

by using stichoza/google-translate-php or Google Translate API  or Yandex Translatin API

Str facade api-translation helpers
----------------------------------

[](#str-facade-api-translation-helpers)

This package provides two translation methods for Laravel helper Str

- `Illuminate\Support\Str::apiTranslate` -&gt; Translates texts using your selected api in config
- `Illuminate\Support\Str::apiTranslateWithAttributes` -&gt; Again translates texts using your selected api in config in addition to that this function ***respects Laravel translation text attributes*** like :name

How to use your own translation API
-----------------------------------

[](#how-to-use-your-own-translation-api)

- Create your own translation API class by implementing `Tanmuhittin\LaravelGoogleTranslate\Contracts\ApiTranslatorContract`.
- Set your classname in `config/laravel_google_translate.php` under the `custom_api_translator` key.
- Set your custom API key for your custom class in the `custom_api_translator_key` key in the config file, or ideally in the `CUSTOM_API_TRANSLATOR_KEY` environment variable.

Example:
*config/laravel\_google\_translate.php*

```
'custom_api_translator' => env('CUSTOM_API_TRANSLATOR', Myclass::class),
'custom_api_translator_key' => env('CUSTOM_API_TRANSLATOR_KEY', null),
```

Now all translations will use your custom api.

installation
------------

[](#installation)

```
composer require --dev 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.

Then you can run:

```
php artisan translate:files
```

See it on action:

[![laravel-google-translate](https://camo.githubusercontent.com/982b85254798c3f8bb4ecbff178fe3383323e66202d82b40716ffd5296b3e6f6/687474703a2f2f6d7568697474696e74616e2e636f6d2f74616e6d7568697474696e2d6c61726176656c2d676f6f676c652d7472616e736c6174652e676966)](https://camo.githubusercontent.com/982b85254798c3f8bb4ecbff178fe3383323e66202d82b40716ffd5296b3e6f6/687474703a2f2f6d7568697474696e74616e2e636f6d2f74616e6d7568697474696e2d6c61726176656c2d676f6f676c652d7472616e736c6174652e676966)

potential issues
----------------

[](#potential-issues)

### SSL certificate problem: unable to get local issuer certificate

[](#ssl-certificate-problem-unable-to-get-local-issuer-certificate)

suggested packages
------------------

[](#suggested-packages)

This package can be used with .

- Add base Laravel translation files using
- Translate your custom files using this package

Done

finally
-------

[](#finally)

Thank you for using laravel-google-translate :)

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance51

Moderate activity, may be stable

Popularity62

Solid adoption and visibility

Community36

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 84.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~88 days

Recently: every ~213 days

Total

28

Last Release

332d ago

Major Versions

0.12 → 1.0.02019-05-23

1.0.4 → 2.0.02020-06-26

PHP version history (3 changes)0.1PHP &gt;=7.0.0

2.1.0PHP &gt;=7.1.0

2.4.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/c98881ffdc8fa24c31fd0ce6bd38ceb60d4bbb02fb623fa97ed751771ab73879?d=identicon)[tanmuhittin](/maintainers/tanmuhittin)

---

Top Contributors

[![tanmuhittin](https://avatars.githubusercontent.com/u/7202383?v=4)](https://github.com/tanmuhittin "tanmuhittin (85 commits)")[![neoteknic](https://avatars.githubusercontent.com/u/1809652?v=4)](https://github.com/neoteknic "neoteknic (2 commits)")[![DanielMalmgren](https://avatars.githubusercontent.com/u/2837262?v=4)](https://github.com/DanielMalmgren "DanielMalmgren (1 commits)")[![exussum12](https://avatars.githubusercontent.com/u/1102850?v=4)](https://github.com/exussum12 "exussum12 (1 commits)")[![JoshKisb](https://avatars.githubusercontent.com/u/7253780?v=4)](https://github.com/JoshKisb "JoshKisb (1 commits)")[![kaneymhf](https://avatars.githubusercontent.com/u/15618401?v=4)](https://github.com/kaneymhf "kaneymhf (1 commits)")[![kaziu687](https://avatars.githubusercontent.com/u/1757563?v=4)](https://github.com/kaziu687 "kaziu687 (1 commits)")[![lrljoe](https://avatars.githubusercontent.com/u/104938042?v=4)](https://github.com/lrljoe "lrljoe (1 commits)")[![luisszzuniga](https://avatars.githubusercontent.com/u/78761028?v=4)](https://github.com/luisszzuniga "luisszzuniga (1 commits)")[![MarnuLombard](https://avatars.githubusercontent.com/u/2191786?v=4)](https://github.com/MarnuLombard "MarnuLombard (1 commits)")[![rubensrocha](https://avatars.githubusercontent.com/u/10297656?v=4)](https://github.com/rubensrocha "rubensrocha (1 commits)")[![Stichoza](https://avatars.githubusercontent.com/u/1139050?v=4)](https://github.com/Stichoza "Stichoza (1 commits)")[![underdpt](https://avatars.githubusercontent.com/u/8122137?v=4)](https://github.com/underdpt "underdpt (1 commits)")[![ahkmunna](https://avatars.githubusercontent.com/u/9366303?v=4)](https://github.com/ahkmunna "ahkmunna (1 commits)")[![vcardillo](https://avatars.githubusercontent.com/u/567807?v=4)](https://github.com/vcardillo "vcardillo (1 commits)")[![buzzclue](https://avatars.githubusercontent.com/u/43321373?v=4)](https://github.com/buzzclue "buzzclue (1 commits)")

---

Tags

laraveltranslation-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tanmuhittin-laravel-google-translate/health.svg)

```
[![Health](https://phpackages.com/badges/tanmuhittin-laravel-google-translate/health.svg)](https://phpackages.com/packages/tanmuhittin-laravel-google-translate)
```

###  Alternatives

[barryvdh/laravel-translation-manager

Manage Laravel Translations

1.7k3.6M17](/packages/barryvdh-laravel-translation-manager)[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[erag/laravel-disposable-email

A Laravel package to detect and block disposable email addresses.

226102.4k](/packages/erag-laravel-disposable-email)[laravel-lang/json-fallback

Adds support for fallback JSON string translation

162.2M4](/packages/laravel-lang-json-fallback)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
