PHPackages                             gidkom/ms-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. gidkom/ms-translator

ActiveLibrary[API Development](/categories/api)

gidkom/ms-translator
====================

Translate text using the Microsoft Translate API

56081PHP

Since Feb 27Pushed 11y ago1 watchersCompare

[ Source](https://github.com/gidkom/ms-translator)[ Packagist](https://packagist.org/packages/gidkom/ms-translator)[ RSS](/packages/gidkom-ms-translator/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

ms-translator
=============

[](#ms-translator)

[![Build Status](https://camo.githubusercontent.com/03d94d36aa372d828717fca05130f76c01455969e357affab49933bafefc1081/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6769646b6f6d2f6d732d7472616e736c61746f722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gidkom/ms-translator/build-status/master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/58e7fb212434f08ed6c12f6aff90ec7c8e686d69d886fb5be6cee6ca55cfb16f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6769646b6f6d2f6d732d7472616e736c61746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/gidkom/ms-translator/?branch=master)

Translate text using the Bing Translate API

\##Instruction

Translate your texts using Microsoft's Bing Translation services HTTP API

The code is based on the one provided by Microsoft at the documentation, prepared for composer. In two lines, you can have a translation service working!

Before working with the code, get your Access Token, using your MSN account. More info:

Don't get confused with the clientID. It's not the Customer ID nor your account key. The clientID is the text (possibly your app name or some plain-language text) that you specified when registering your application. You can view your client id

There is a free data tier of 2 million characters per month. Check  if you haven't used yet your monthly limit:

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

[](#installation)

### With Composer

[](#with-composer)

---

The easiest way to install is via [composer](http://getcomposer.org/). Create the following `composer.json` file and run the `php composer.phar` install command to install it.

```
{
	...
    "require": {
        "gidkom/ms-translator": "dev-master"
    }
}
```

then the code

```
include "vendor/autoload.php";

$client_id = 'abc';
$client_secret = 'xyz';

$mt = new Gidkom\MsTranslator\MsTranslator($client_id, $client_secret);

//Translate to single language
$from  = 'en';
$to = 'fr';
return $mt->translate('Hello world', $to, $from);

// To auto detect language leave out the $from argument
return $mt->translate('Hello world', $to);

Translate to multiple languagues
$from = 'en';
$to= ['fr', 'de'];
return $mt->multiTranslate('Hello world', $to, $from);
```

for a list of all supported languages and codes go to `public/ms-translator-language-codes.txt`

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![gidkom](https://avatars.githubusercontent.com/u/4060499?v=4)](https://github.com/gidkom "gidkom (16 commits)")

### Embed Badge

![Health badge](/badges/gidkom-ms-translator/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M451](/packages/google-gax)

PHPackages © 2026

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