PHP code example of sportmob / translation-client
1. Go to this page and download the library: Download sportmob/translation-client 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/ */
sportmob / translation-client example snippets
use SportMob\Translation\Client;
$translationServiceBaseUrl = 'http://localhost';
$redisHost = 'redis';
$redisPort = 6379;
$client = new Client($translationServiceBaseUrl, $redisHost, $redisPort);
$id = 'qweasdzxcv'; // sportmob id
$language = 'ar'; // target language
$translate = $client->getByEntityId($id, $language);
var_dump($translate);
/*
result:
string "ریال مدرید"
*/