2017 © Pedro Peláez
 

library microsoft-translation-api

Access to the free Microsoft's HTTP translation API

image

natxet/microsoft-translation-api

Access to the free Microsoft's HTTP translation API

  • Friday, May 24, 2013
  • by natxet
  • Repository
  • 3 Watchers
  • 10 Stars
  • 291 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 2 Open issues
  • 1 Versions
  • 1 % Grown

The README.md

Translate your texts using Microsoft's Bing Translation services HTTP API http://msdn.microsoft.com/en-us/library/ff512419.aspx, (*1)

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!, (*2)

Before working with the code, get your Access Token, using your MSN account. More info at: http://msdn.microsoft.com/en-us/library/hh454950.aspx, (*3)

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 here: https://datamarket.azure.com/developer/applications, (*4)

There is a free data tier of 2 million characters per month. Check here if you haven't used yet your monthly limit: https://datamarket.azure.com/account/datasets, (*5)

Use with composer:, (*6)

{
    "require": {
        "natxet/microsoft-translation-api": "*"
    },
    "minimum-stability": "dev"
}

And then code something like this:, (*7)

include "vendor/autoload.php";
$config      = array( 'clientID' => 'myproject', 'clientSecret' => 'PYdLDxusfg4+MPdLDxudLDxusfg4+sfg4+Q1XixZ=');
$translator  = new \MicrosoftTranslator\Translate( $config );
$translation = $translator->translate(array('Hola', 'Adiós'), 'en', 'es');
var_dump( $translation );

The Versions

24/05 2013

dev-master

9999999-dev http://msdn.microsoft.com/en-us/library/ff512419.aspx

Access to the free Microsoft's HTTP translation API

  Sources   Download

The Requires

  • php >=5.0

 

translation microsoft