PHP code example of webazon / yandex-translator

1. Go to this page and download the library: Download webazon/yandex-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/ */

    

webazon / yandex-translator example snippets


$translator = new Translator(["folder_id"=> "<ID каталога>", "ApiKey"=>'<API-ключ>']);
$translate = $translator->Translate('Hello, World','en-ru');
$text = $translate -> text;

$translate = $translator->listLanguages();

$translator = new Translator(["folder_id"=> "<Catalog ID>", "ApiKey"=>'<API-key>']);
$translate = $translator->Translate('Hello, World','en-ru');
$text = $translate -> text;

$translate = $translator->listLanguages();