PHP SDK
Official PHP SDK for the Langsys Translation API. Manage translations, register phrases, and sync your application’s translatable content. The Laravel package is a thin wrapper over this client.
Requirements
Section titled “Requirements”- PHP 7.4 or higher (tested up to PHP 8.4)
- cURL extension
- JSON extension
- intl extension (for ICU plurals and locale-aware number/date formatting)
- Redis extension (optional, for Redis caching)
In this package
Section titled “In this package” Install Composer or a manual autoload, plus a five-line quick start. Configuration Environment variables and constructor options. API key types Read keys look up; write keys also register new phrases. Translate a phrase translate(), {name} interpolation, ICU plurals, and exclusions. Full page translation translatePage() — titles, meta, body, categories, selectors. Content blocks Fetching catalogs and translating HTML fragments. Registration & sync Queue, flush, registerPhrases, content blocks, and sync(). Caching File, Redis, or none — plus cache busting. Logging Optional JSON Lines logs and the built-in viewer. Error handling Authentication, validation, and API exceptions. Project & utilities Project metadata plus countries, dial codes, and locales. Testing PHPUnit with a mock HTTP client.