A PHP library to interface with the Gengo API for translation.
PHP
Latest commit 2b37b2f Mar 17, 2017 @ryanannatuvasquez ryanannatuvasquez committed on GitHub Fix getJobs parameter adding to data parameter (#52)
* Dont add to data parameter

* update changelog

* Create test for count
Permalink
Failed to load latest commit information.
src Fix getJobs parameter adding to data parameter (#52) Mar 17, 2017
tests Fix getJobs parameter adding to data parameter (#52) Mar 17, 2017
.gitignore add vendor dir to gitignore Sep 29, 2016
.php_cs update php-cs-fixer to keep package declaration Sep 30, 2016
.travis.yml Cleaned up composer.json: moved php-cs-fixer to require-dev and enabl… Oct 3, 2016
LICENSE.txt Gengo PHP API 3.0.0 Aug 29, 2016
README.md add formatting to readme Sep 29, 2016
build.xml Modified build.xml: should create vendor_production to avoid use of u… Oct 3, 2016
changelog.md
composer.json Upgraded tests to PHPUnit 5.7; using new best practice for exception … Jan 27, 2017
phpda.yml Gengo PHP API 3.0.0 Aug 29, 2016
phpunit.xml Modified build.xml: should create vendor_production to avoid use of u… Oct 3, 2016

README.md

Build Status

Gengo PHP Library (for the Gengo API)

Translating your tools and products helps people all over the world access them; this is, of course, a somewhat tricky problem to solve. Gengo is a service that offers human-translation (which is often a higher quality than machine translation), and an API to manage sending in work and watching jobs. This is a PHP interface to make using the API simpler (some would say incredibly easy).

This package contains both a client library for accessing the Gengo Translate API, as well as some example code showing how to use the library.

Installation & Requirements

Installing the library is simple. Just add it to "require" of your composer.json

Then inside of your code you can call:

\Gengo\Config::setAPIkey("your_api_key");
\Gengo\Config::setPrivateKey("your_private_key");

$job1 = array(
 "type"     => "text",
 "slug"     => "API Liverpool 1",
 "body_src" => "Liverpool_1 Football Club is an English Premier League football club based in Liverpool, Merseyside.",
 "lc_src"   => "en",
 "lc_tgt"   => "ja",
 "tier"     => "standard",
 "force"    => 1,
);

$jobs = array("job_01" => $job1);

$api = new \Gengo\Jobs();
$api->postJobs($jobs);
$response = json_decode($api->getResponseBody(), true);

When you are ready to go live insert the following before calls to Gengo:

\Gengo\Config::useProduction();

You can read through files in tests folder for more usage examples.

Question, Comments, Complaints, Praise?

If you have questions or comments and would like to reach us directly, please feel free to do so at the following outlets. We love hearing from developers!

  • Email: api [at] gengo dot com
  • Twitter: @gengoit
  • IRC: #gengo

If you come across any issues, please file them on the Github project issue tracker. Thanks!

Documentation

Check out the full Gengo API documentation.