PHPackages                             mgcodeur/super-translator - 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. mgcodeur/super-translator

ActiveLibrary[API Development](/categories/api)

mgcodeur/super-translator
=========================

SuperTranslator is a PHP package that allows you to translate text from one language to another using the Google Translate API.

1.0.5(2y ago)382[1 issues](https://github.com/mgcodeur/php-super-translator/issues)MITPHP

Since Jul 15Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mgcodeur/php-super-translator)[ Packagist](https://packagist.org/packages/mgcodeur/super-translator)[ RSS](/packages/mgcodeur-super-translator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (3)Versions (7)Used By (0)

[![Run Tests](https://github.com/mgcodeur/php-super-translator/actions/workflows/test.yml/badge.svg)](https://github.com/mgcodeur/php-super-translator/actions/workflows/test.yml)[![Packagist Downloads (custom server)](https://camo.githubusercontent.com/36cdcd4ce9b7ae33ab8fb4d2c4bc217756857195bd4f774eb7be2ebdd806f1d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d67636f646575722f73757065722d7472616e736c61746f723f7374796c653d666c61742d737175617265266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d626c756526636f6c6f723d6f72616e6765)](https://camo.githubusercontent.com/36cdcd4ce9b7ae33ab8fb4d2c4bc217756857195bd4f774eb7be2ebdd806f1d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d67636f646575722f73757065722d7472616e736c61746f723f7374796c653d666c61742d737175617265266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d626c756526636f6c6f723d6f72616e6765)

About SuperTranslator
---------------------

[](#about-supertranslator)

SuperTranslator is a PHP package that allows you to translate text from one language to another using the Google Translate API.

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

[](#installation)

Install the package via composer:

```
composer require mgcodeur/super-translator
```

Basic Usage
-----------

[](#basic-usage)

```
require_once 'vendor/autoload.php'; // if you don't use autoloading
use Mgcodeur\SuperTranslator\GoogleTranslate;

$from = 'en';
$to = 'fr';
$text = 'Hello World!';

$translatedText = GoogleTranslate::translate($from, $to, $text);
echo $translatedText;
// Output: Bonjour le monde!
```

Automatic language detection
----------------------------

[](#automatic-language-detection)

If you want to automatically detect the language of the text to translate, you can use the `translateAuto` method of the `GoogleTranslate` class like this:

```
require_once 'vendor/autoload.php'; // if you don't use autoloading
use Mgcodeur\SuperTranslator\GoogleTranslate;

$to = 'fr';
$text = 'Hello World!';

$translatedText = GoogleTranslate::translateAuto($to, $text);
echo $translatedText;
// Output: Bonjour le monde!
```

You can alse use 'auto' as the value of the `$from` parameter:

```
require_once 'vendor/autoload.php'; // if you don't use autoloading
use Mgcodeur\SuperTranslator\GoogleTranslate;

$from = 'auto';
$to = 'fr';
$text = 'Hello World!';

$translatedText = GoogleTranslate::translate($from, $to, $text);
echo $translatedText;
// Output: Bonjour le monde!
```

Translate multiple languages
----------------------------

[](#translate-multiple-languages)

If you want to translate a text into multiple languages, you just have to pass an array of languages to the `translate` or `translateAuto` method of the `GoogleTranslate` class like this:

```
require_once 'vendor/autoload.php'; // if you don't use autoloading
use Mgcodeur\SuperTranslator\GoogleTranslate;

$from = 'en';
$to = ['fr', 'es', 'de'];

$text = 'Hello World!';

$translatedText = GoogleTranslate::translate($from, $to, $text);

//Nb: the $translatedText variable is an array

# Output: [
#    'fr' => 'Bonjour le monde!',
#    'es' => '¡Hola Mundo!',
#    'de' => 'Hallo Welt!'
# ]
```

 [ ![](https://camo.githubusercontent.com/afb33de6ac09f258444ea631fcffcf1fe6c8a719a1f243deaf45d841abb8027f/68747470733a2f2f696d672e6275796d6561636f666665652e636f6d2f627574746f6e2d6170692f3f746578743d4275792532306d6525323061253230636f6666656526656d6f6a693d26736c75673d6d67636f6465757226627574746f6e5f636f6c6f75723d46463546354626666f6e745f636f6c6f75723d66666666666626666f6e745f66616d696c793d506f7070696e73266f75746c696e655f636f6c6f75723d30303030303026636f666665655f636f6c6f75723d464644443030) ](https://buymeacoffee.com/mgcodeur)

Contributors ✨
--------------

[](#contributors-)

Thanks go to these wonderful people ✨:

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Every ~33 days

Total

5

Last Release

907d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a2698331a7a55cc476ee9229bcaa167b2e3fe590ff989e0b40465e643c672e1?d=identicon)[mgcodeur](/maintainers/mgcodeur)

---

Top Contributors

[![mgcodeur](https://avatars.githubusercontent.com/u/91603608?v=4)](https://github.com/mgcodeur "mgcodeur (17 commits)")

---

Tags

phpapilanguagetranslategoogletranslationtexttranslatorgoogle apifreegoogle-translateGoogle Translate APItranslate-api

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mgcodeur-super-translator/health.svg)

```
[![Health](https://phpackages.com/badges/mgcodeur-super-translator/health.svg)](https://phpackages.com/packages/mgcodeur-super-translator)
```

###  Alternatives

[google/cloud

Google Cloud Client Library

1.2k16.2M53](/packages/google-cloud)[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)[chriskonnertz/deeply

DeepLy is a PHP client for the DeepL.com translation API

230116.2k8](/packages/chriskonnertz-deeply)[eko/googletranslatebundle

A Symfony bundle to deals with Google Translate API

4337.1k](/packages/eko-googletranslatebundle)

PHPackages © 2026

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