sportmob / translation-client
A PHP package to translate phrases for the SportMob project
v1.2.1
2021-11-16 13:13 UTC
Requires
- php: ^7.4
- guzzlehttp/guzzle: 6.5.5
- predis/predis: ^1.1.3
- sentry/sdk: ^2.1
Requires (Dev)
- phpunit/phpunit: 9.3.*
- symfony/var-dumper: 4.4.*
README
This package is used to call translation service as easy as possible by other services.
Installation
To Install it:
composer require sportmob/translation-client
Example
this is a simple example how to use it.
<?php 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 "ریال مدرید" */