PHPackages                             stratoss/yii2-google-translate-api - 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. [API Development](/categories/api)
4. /
5. stratoss/yii2-google-translate-api

ActiveYii2-extension[API Development](/categories/api)

stratoss/yii2-google-translate-api
==================================

Yii2 extension to Google Translate API

1.1.4(9y ago)187BSD-3-ClausePHP

Since Feb 18Pushed 9y ago1 watchersCompare

[ Source](https://github.com/stratoss/yii2-google-translate-api)[ Packagist](https://packagist.org/packages/stratoss/yii2-google-translate-api)[ RSS](/packages/stratoss-yii2-google-translate-api/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (6)Dependencies (1)Versions (6)Used By (0)

[original project](https://github.com/RichWeber/yii2-google-translate-api)

Yii2 extension to Google Translate API
======================================

[](#yii2-extension-to-google-translate-api)

Google Translate API

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require stratoss/yii2-google-translate-api "dev-master"

```

or add

```
"stratoss/yii2-google-translate-api": "dev-master"

```

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

### Identifying your application to Google

[](#identifying-your-application-to-google)

If you haven't done so already, create your project's API key by following these steps:

1. Go to the [Google Developers Console](https://console.developers.google.com/?_ga=1.82915478.1231386659.1424296121).
2. Select a project, or create a new one.
3. In the sidebar on the left, **expand APIs &amp; auth**. Next, click **APIs**. In the list of APIs, make sure the status is **ON** for the Google Translate API.
4. In the sidebar on the left, select **Credentials**.
5. To create an API key, click **Create new Key** and select the appropriate key type. Enter the additional information required for that key type and click **Create**.

[Read more...](https://cloud.google.com/translate/v2/using_rest)

### Component Configuration

[](#component-configuration)

```
'components' => [
    ...
    'translate' => [
        'class' => 'stratoss\google\translate\Translation',
        'key' => 'INSERT-YOUR-API-KEY',
    ],
    ...
],
```

```
Yii::$app->translate->translate($source, $target, "Hello World");
```

```
Yii::$app->translate->translate($source, $target, ["Hello World", "Hello, my name is John Doe"]);
```

```
Yii::$app->translate->discover();
```

```
Yii::$app->translate->detect($text);
```

### License

[](#license)

**yii2-google-translate-api** is released under the BSD 3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 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

Every ~137 days

Total

5

Last Release

3553d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2014fb9799a16a8f980d39b66f4da2a64889a432497c80d63f306b22b4d07cc5?d=identicon)[stratoss](/maintainers/stratoss)

---

Top Contributors

[![RichWeber](https://avatars.githubusercontent.com/u/1702252?v=4)](https://github.com/RichWeber "RichWeber (5 commits)")

---

Tags

apitranslategoogleyii2

### Embed Badge

![Health badge](/badges/stratoss-yii2-google-translate-api/health.svg)

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

###  Alternatives

[statickidz/php-google-translate-free

Google Translate Free library for PHP

289258.8k6](/packages/statickidz-php-google-translate-free)[dejurin/php-google-translate-for-free

Library for free use Google Translator. With attempts connecting on failure and array support.

13943.0k2](/packages/dejurin-php-google-translate-for-free)[eko/googletranslatebundle

A Symfony bundle to deals with Google Translate API

4337.1k](/packages/eko-googletranslatebundle)[skeeks/yii2-google-api

Component for work with google api based on google/apiclient

1243.1k1](/packages/skeeks-yii2-google-api)[dotzero/yii2-amocrm

Расширение для Yii Framework 2 реализующее клиент для работы с API amoCRM

1639.7k](/packages/dotzero-yii2-amocrm)

PHPackages © 2026

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