Skip to content

Little weight PHP class to string translate using Microsoft Translator

Notifications You must be signed in to change notification settings

fireveined/php-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

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

About

Little weight PHP class to string translate using Microsoft Translator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages