lingo24/api-client

Client library for Lingo24's translation APIs.

2.3.0 2020-02-28 09:34 UTC

This package is auto-updated.

Last update: 2024-12-13 15:59:46 UTC


README

We love languages at Lingo24. Every day we work hard to translate documents, websites, tools and products, helping people all over the world communicate with one another.

Translating your content can be challenging, but we aim to make it very simple through easy to use tools, friendly people, and great technology.

In terms of translation, Lingo24 offers a range of professional human-translation and premium machine translation services, all of which can accessed via our translation APIs.

This is a PHP interface to make using our APIs simpler.

Installation & Requirements

Installing the Lingo24 API client is easy using Composer, simply include the library as a dependency in your configuration file:

"require": {
    "lingo24/api-client": "=2.*"
}

Questions, Comments, Complaints, Compliments?

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!

If you come across any issues with the library, please file them on the project’s Bitbucket issue tracker.

Accessing Our Premium Machine Translation API

To get started with the API you first have to authenticate. You do this by using the authentication information you received when you signed up on the Lingo24 Developer Portal.

$lingo24 = new \Lingo24\API\MT('your_user_key')

If you do not have an _userkey please go to our plans page to sign up for one of our access plans. This includes our free Premium Machine Translation Taster plan, with free access to translate 100,000 between English, French and Spanish.

Once you have done this you are free to use the methods exposed via the API wrapper to translate text, fetch source languages and fetch target languages. You can also view the methods available on the online Lingo24 API documentation.

Accessing Our Business Documents API

To get started with the API you must first contact us to create a customer account linked to your Lingo24 Developer Portal account. Authentication with the Business Documents API is performed using OAuth2. To start using API functionality your users will need to authenticate, your application should redirect users to our Ease Client Portal, passing the request type (code), client id and redirect URI as POST parameters. Once authorised the Ease portal will redirect users and provide an authorisation code. The authorisation code can then used to create the library.

$lingo24Docs = new \Lingo24\API\Docs('your_client_id', 'your_client_secret', 'your_application_url', 'authorisation code');

Once you have done this you are free to use the methods exposed via the API wrapper to create and manage jobs and projects. You can view the methods available on the online Lingo24 API documentation.

Project Wizard

The API client library provides a "Project Wizard" as a convenient way of scripting project and job creation. The Wizard allows you to add multiple source files and target locales, then create jobs for each combination.

$lingo24Project = (new \Lingo24\API\ProjectWizard('My Project'))
    ->setDomain($lingo24Domain)
    ->setService($lingo24Service)
    ->setSourceLocale($lingo24SourceLocale)
    ->addFile('/tmp/file1.txt', 'My First File')
    ->addFile('/tmp/file2.txt', 'My Second File')
    ->addTargetLocale($lingo24TargetLocale1)
    ->addTargetLocale($lingo24TargetLocale2)
    ->create($lingo24Docs);

The example above will create a project containing four jobs, once for each of the file / target locale combinations. Once the project has been created it can be used with the Business Documents API library as normal, e.g.

$lingo24Docs->confirmProject($lingo24Project);