Little weight PHP class to string translate using Microsoft Translator
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