PHP code example of fernandopetry / translatebygoogle

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

    

fernandopetry / translatebygoogle example snippets



 \Petry\Translate\Locale\pt_BR;
 use \Petry\Translate\Locale\en_US;

$txtSource = "Eu te amo";
$txtExpected = "I love you";

$translate = new \Petry\Translate\Translate($txtSource, new pt_BR, new en_US);

var_dump($translate->getTranslate());