PHP code example of alessiodh / deepltranslator

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

    

alessiodh / deepltranslator example snippets

 artisan deepl:translate en nl

namespace App\Http\Controllers;

use Alessiodh\Deepltranslator\Traits\DeepltranslatorTrait;

class MyTestController extends Controller
{
    use DeepltranslatorTrait;

    public function home(){
        $translated = $this->translateString('This is a test', 'en', ['fr','nl','ru']);

        /*
            $translated = [
              "fr" => "Il s'agit d'un test",
              "nl" => "Dit is een test",
              "ru" => "Это тест"
            ];
        */
    }
}