PHP code example of mistralys / deepl-xml-translator
1. Go to this page and download the library: Download mistralys/deepl-xml-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/ */
mistralys / deepl-xml-translator example snippets
$translator = new \DeeplXML\Translator(
'YourAPIKey', // the DeepL API key to use to connect
'EN', // source language
'DE' // target language
);
$translator->addString('string1', 'Please translate me');
$translator->addString('string2', 'Please also translate me');
$string = $translator->addString('string1', 'Please ignore me');
// the text "ignore" will not be translated in the string
$string->addIgnoreString('ignore');
$api = $translator->getConnector();
// do something with it
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.