signoredellarete / deepl-api

Simple implementation of a web translator realised using php + html + deepl-php + DeepL API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

deepl-api

Simple implementation of a web translator realised using php + html + deepl-php + DeepL API

Pre-requisites

Configuration

  • In the index.php file remember to replace the API $authKey value with your own key obtained from DeepL web site.

    <?php
      session_start();
      require __DIR__.'/../vendor/autoload.php';
      $authKey = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:xx"; // Replace with your key
      $translator = new \DeepL\Translator($authKey);
      $usage = $translator->getUsage();
    ...
    
  • You can add languages in the $langs values of the index.php:

    $langs = [
      [
        "name" => "Italian",
        "value" => "IT",
        "flag" => "&#x1F1EE&#x1F1F9"
      ],
      [
        "name" => "English",
        "value" => "EN-GB",
        "flag" => "&#x1F1EC&#x1F1E7"
      ],
    ...
    

About

Simple implementation of a web translator realised using php + html + deepl-php + DeepL API

License:GNU General Public License v3.0


Languages

Language:PHP 100.0%