Skip to content

dhensen/translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

translator

Provides translation clients for a few known translation services. At this moment supports:

  • Bing/Microsoft Azure Translator

Installation

composer require dhensen/translator

Usage

Bing/Azure:

    $browser           = new \Buzz\Browser();
    $azureClientId     = 'your_microsoft_azure_client_id';
    $azureClientSecret = 'your_microsoft_azure_client_secret';
    $translator        = new \DHensen\Translator\Bing\BingTranslator($browser, $azureClientId, $azureClientSecret);
    echo $translator->translate('nl', 'en', 'Ik eet soep'); // prints: I eat soup

Google unofficial:

$browser = new \Buzz\Browser();
$translator = new \DHensen\Translator\Google\GoogleTranslatorUnofficial($browser);
echo $translator->translate('nl', 'en', 'Wat ben jij aan het doen?'); // prints: What are you doing?

About

Provides translation clients for a few known translation services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages