Recommend this page to a friend! |
![]() |
Info | Documentation | ![]() |
![]() |
![]() |
Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 59 | All time: 10,526 This week: 45![]() |
Version | License | PHP version | Categories | |||
gytranslate 1.0.0 | MIT/X Consortium ... | 8 | Localization, PHP 5, Web services |
Description | Author | |
This class can translate texts with Google or Yandex APIs. |
require 'path/to/vendor/autoload.php';
use Mateodioev\Translate;
$tr = new Translate;
$res = $tr->google('Your text to translate', 'source_lang', 'target_lang');
$key = 'YOUR_API_KEY'; // see: https://translate.yandex.com/developers/keys
$res = $tr->yandex($key, 'Your text to translate', 'source_lang', 'target_lang'),
$tr->setText('Hello world!')->setInputLang('en')->setOutputLang('es');
$res = $tr->yandex($key);
$res = $tr->google();
# Use any of the above methods
$tr->getText();
$dir = 'input or output';
$tr->getLangName($dir);
Github:
git clone https://github.com/Mateodioev/translate
cd translate
composer install
Composer:
composer require mateodioev/translate
See examples
![]() |
File | Role | Description | ||
---|---|---|---|---|
![]() |
||||
![]() ![]() |
Data | Auxiliary data | ||
![]() ![]() |
Doc. | Documented examples | ||
![]() ![]() |
Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
![]() |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.