Download the PHP package lingodotdev/sdk without Composer
On this page you can find all versions of the php package lingodotdev/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package sdk
Lingo.dev PHP SDK
Official PHP SDK for Lingo.dev, a powerful localization engine that supports various content types including plain text, objects, and chat sequences.
Installation
You can install the SDK via Composer:
Basic Usage
After installing the package, bootstrap the engine with your API key:
Configuration Options
| Option | Type | Required | Default | Description |
|---|---|---|---|---|
apiKey |
string | Yes | — | Your Lingo.dev API key |
engineId |
string | No | — | Your Lingo.dev Engine ID |
apiUrl |
string | No | https://api.lingo.dev |
API base URL |
batchSize |
int | No | 25 |
Max items per chunk (1–250) |
idealBatchItemSize |
int | No | 250 |
Max words per chunk (1–2500) |
Scenarios demonstrated in this README
- Text Localization
- Object Localization
- Chat Localization
- Batch Localization
- Language Detection
- Progress Tracking
Requirements
- PHP 8.1 or higher
- Composer
- GuzzleHttp Client
Getting Started
Creating a New PHP Project with Lingo.dev SDK
Follow these steps to create a new PHP project that uses the Lingo.dev SDK:
-
Create a project directory:
-
Initialize Composer:
- Add Lingo.dev SDK as a dependency:
API Scenarios
Initialize the SDK
Text Localization
Translate a simple text string from one language to another:
Object Localization
Translate an array of strings while preserving the structure:
You can pass a reference to provide additional context:
Chat Localization
Translate a chat conversation while preserving speaker names:
Language Detection
Detect the language of a given text:
Batch Localization
Translate a text to multiple languages at once:
Progress Tracking
Track the progress of a localization operation:
Demo App
If you prefer to start with a minimal example instead of the detailed scenarios above, create index.php in an empty folder, copy the following snippet, install dependencies with composer require lingodotdev/sdk, set LINGODOTDEV_API_KEY (and optionally LINGODOTDEV_ENGINE_ID), and run php index.php.
Want to see everything in action?
- Clone this repository or copy the
index.phpfrom the demo below into an empty directory. - Run
composer installto pull in the SDK. - Populate the
LINGODOTDEV_API_KEYenvironment variable (and optionallyLINGODOTDEV_ENGINE_ID). - Execute the script with
php index.phpand observe the output.
index.php demo:
Release Process
The SDK uses semantic versioning (MAJOR.MINOR.PATCH) and is automatically published to Packagist when changes are merged to the main branch. The release process includes:
- Running tests to ensure code quality
- Detecting the current version from git tags
- Automatically bumping the patch version
- Creating a new git tag for the new version
Packagist automatically fetches new versions from the GitHub repository when tags are pushed, making the new version immediately available for installation via Composer. The version is determined by git tags rather than being stored in composer.json, following Packagist best practices.
Documentation
For more detailed documentation, visit the Lingo.dev Documentation.
License
This SDK is released under the MIT License.