prihod / promt-translate
Client for PROMT translate API
Installs: 11
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/prihod/promt-translate
Requires
- php: >=5.3
- ext-curl: *
README
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require prihod/promt-translate
Usage example
<?php require_once(dirname(__FILE__) . '/vendor/autoload.php'); use Prihod\Translate\Translator; use Prihod\Translate\Exception; try { $translator = new Translator($key); $translation = $translator->translate('Hello world', 'en','ru'); echo $translation; // Привет мир echo $translation->getSource(); // Hello world; echo $translation->getSourceLanguage(); // en echo $translation->getResultLanguage(); // ru } catch (Exception $e) { // handle exception }