PHP code example of vanengers / catalog-translator
1. Go to this page and download the library: Download vanengers/catalog-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/ */
$extracted = new \Symfony\Component\Translation\MessageCatalogue('en-GB',[
'domain' => [
'This is a base language key' => 'This is a base language key'
]
]);
$translateTo = ['nl-NL', 'de-DE'];
$external = new \Vanengers\CatalogTranslator\Client\DeeplClient([
'api_key' => 'your-deepl-api-key'
]);