Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (4) | Download .zip | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not yet rated by the users | Total: 57 | All time: 10,524 This week: 524 |
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
Files |
File | Role | Description | ||
---|---|---|---|---|
src (1 file) | ||||
composer.json | Data | Auxiliary data | ||
examples.md | Doc. | Documented examples | ||
README.md | Doc. | Documentation |
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.