Skip to content

itgopher/yandex-translate

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yandex Translate API

Latest Stable Version Total Downloads Latest Unstable Version License

Api reference

Usage

Add into your composer.json:

{
  "require": {
    "nkt/yandex-translate": "~1.0"
  }
}
use Yandex\Translate\Translator;
use Yandex\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
}

License

MIT

About

Wrapper for Yandex.Translate API

Resources

License

Stars

Watchers

Forks

Packages

No packages published