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.3(2mo ago)4342.3M↓55.4%72[16 issues](https://github.com/tanmuhittin/laravel-google-translate/issues)[6 PRs](https://github.com/tanmuhittin/laravel-google-translate/pulls)11MITPHPPHP &gt;=8.2CI failing

Since Dec 11Pushed 2mo 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 2d ago

READMEChangelog (10)Dependencies (16)Versions (30)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

71

—

ExcellentBetter than 100% of packages

Maintenance86

Actively maintained with recent releases

Popularity62

Solid adoption and visibility

Community36

Small or concentrated contributor base

Maturity85

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 83.3% 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 ~96 days

Recently: every ~189 days

Total

29

Last Release

71d 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://avatars.githubusercontent.com/u/7202383?v=4)[Muhittin Tan](/maintainers/tanmuhittin)[@tanmuhittin](https://github.com/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)")[![Luke-Shepp](https://avatars.githubusercontent.com/u/35956374?v=4)](https://github.com/Luke-Shepp "Luke-Shepp (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

[laravel/sail

Docker files for running a basic Laravel application.

1.9k205.7M1.3k](/packages/laravel-sail)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M194](/packages/laravel-ai)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[tallstackui/tallstackui

TallStackUI is a powerful suite of Blade components that elevate your workflow of Livewire applications.

725173.0k14](/packages/tallstackui-tallstackui)[propaganistas/laravel-disposable-email

Disposable email validator

6023.0M6](/packages/propaganistas-laravel-disposable-email)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k91.0k1](/packages/mike-bronner-laravel-model-caching)

PHPackages © 2026

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