PHPackages                             colender/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. colender/google-translate

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

colender/google-translate
=========================

Free Laravel package for Paid Google Translate REST API

1.0.0(7y ago)0331MITPHPPHP &gt;=5.5.9

Since Aug 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/colender/google-translate)[ Packagist](https://packagist.org/packages/colender/google-translate)[ Docs](http://github.com/colender/google-translate)[ RSS](/packages/colender-google-translate/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (2)Used By (1)

Laravel package for Google Translate REST API
=============================================

[](#laravel-package-for-google-translate-rest-api)

[![Downloads Total](https://camo.githubusercontent.com/180e8f68ba12351a71d84d23190c4e62ea94749b8de4427d6d9139f7ca633406/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64646374643134332f676f6f676c652d7472616e736c6174652e737667)](https://packagist.org/packages/ddctd143/google-translate)

Package allows to work with [Google Translate API](https://cloud.google.com/translate/)

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

[](#installation)

Package can be installed using composer by adding to "require" object

```
"require": {
    "ddctd143/google-translate": "dev-master"
}

```

or from console:

```
composer require ddctd143/google-translate dev-master

```

Configuration
-------------

[](#configuration)

You should publish config file to be able to add your Google API key. To publish config you should do:

```
php artisan vendor:publish \
--provider="Dedicated\GoogleTranslate\GoogleTranslateProvider" --tag=config

```

After config is published, you will have it in `config\google-translate.php` of your Laravel project directory

You should change only one line:

```
    ...

    /**
     * Google key for authentication
     */
    'api_key' => 'YOUR-GOOGLE-API-KEY-GOES-HERE',

    ...

```

Usage
-----

[](#usage)

To translate text with given source language and target language:

```
$translator = new Dedicated\GoogleTranslate\Translator;

$result = $translator->setSourceLang('en')
                     ->setTargetLang('ru')
                     ->translate('Hello World');

dd($result); // "Привет мир"

```

By default language detection is turned on, so you can translate text without specifying source language.

This will make 2 requests to google API:

- First request will go to /detect URL and get source language name
- Second request will make actual translate request and give out result.

```
$translator = new Dedicated\GoogleTranslate\Translator;

$result = $translator->setTargetLang('ru')
                     ->translate('Hello World');

dd($result); // "Привет мир"

```

You can also use function to only detect text's source language:

```

$result = $translator->detect('Hello World');

dd($result); // "en"

```

### License

[](#license)

This repository code is open-sourced software licensed under the MIT license

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2815d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3bc968576d8a8effdb0ecbed7d56fb7514783181ae517a3e6d4f6bee77d888f9?d=identicon)[colender](/maintainers/colender)

---

Top Contributors

[![colender](https://avatars.githubusercontent.com/u/185928?v=4)](https://github.com/colender "colender (1 commits)")

---

Tags

phplaraveltranslategoogle

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[stevebauman/location

Retrieve a user's location by their IP Address

1.3k7.6M65](/packages/stevebauman-location)[gehrisandro/tailwind-merge-laravel

TailwindMerge for Laravel merges multiple Tailwind CSS classes by automatically resolving conflicts between them

341682.2k18](/packages/gehrisandro-tailwind-merge-laravel)[amranidev/laracombee

Recommendation system for laravel

11636.7k1](/packages/amranidev-laracombee)[aurawindsurfing/google-translate

Free Laravel package for Paid Google Translate REST API with your own API key

1119.5k1](/packages/aurawindsurfing-google-translate)[tomatophp/filament-seo

Manage and generate SEO tags and integrate your website with Google SEO services

112.6k1](/packages/tomatophp-filament-seo)

PHPackages © 2026

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