1. Go to this page and download the library: Download webcook/translator library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
webcook / translator example snippets
$factory = new Webcook\Translator\ServiceFactory();
$service = $factory->build(
Webcook\Translator\ServiceFactory::YANDEX,
array(
'key' => 'YOUR API KEY'
)
);
// returns list of available languages
$languages = $service->getLanguages();
// translate text
$translation = $service->translate('Hi, how are you?', 'en', 'cs');