Little weight PHP class to string translate using Microsoft Translator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
php-translator.php

README.md

PHP-Translator

Little weight PHP class to string translate using Microsoft Translator

How to use free Microsoft Translator?

  1. Subscribe to the Microsoft Translator API here
  2. Register your application with Azure DataMarket here

Usage

include 'php-translator.php';
$translator = new PHPTranslator;

$clientID = "id";
$clientSecret = "secret";
$translator->addClient($clientID, $clientSecret);

$translator->debug(true);

// function translate ($stringToTranslate, $toLanguage, [$fromLanguage = "autoDetection"])
echo $translator->translate("W Szczebrzeszynie chrząszcz brzmi w trzcinie.", "en");

When 200.000 free chars is not enough, you can add more accounts by addClient ($clientID, $clientSecret). PHPTranslator will use all of them.

The third parameter of translate is optional, Microsoft Translator can autodetect language.

By Fireveined