omnilang / libretranslate
Omnilang's LibreTranslate, under any PHP host: a self-hosted server (AGPL-3.0) translating texts and HTML, detecting languages, translating files (txt, odt, odp, docx, pptx, epub, html, srt, pdf) - no key by default, one by reference for a server that asks for it, its policy declared as data.
Package info
github.com/glitchr-omnisense/omnilang-libretranslate
pkg:composer/omnilang/libretranslate
Requires
- php: >=8.2
- omnisense/contracts: ^1.0@dev
- omnisense/omnilang: ^1.0@dev
- symfony/http-client: ^6.4|^7.0|^8.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-10 04:09:47 UTC
README
omnisense/omnilang's LibreTranslate, under any PHP host: a server the site runs itself (AGPL-3.0, Argos Translate's models), no key by default.
- translate (
/translate): several texts a request, plain or HTML,autofor a source to detect; the languages (/languages); - detect (
/detect): a language, its confidence (brought from 0-100 to 0-1), the alternatives; - documents (
/translate_file, then the address it gives): txt, odt, odp, docx, pptx, epub, html, srt, pdf.
No glossary, no formality.
use Omnilang\Libretranslate\LibretranslateFactory; use Omnilang\Model\TranslationQuery; $local = (new LibretranslateFactory($httpClient))->create(['base_uri' => 'http://libretranslate:5000']); echo $local->translate(TranslationQuery::text('Bonjour', 'en'))[0]->text;
# a server beside the site (docker compose) libretranslate: image: libretranslate/libretranslate environment: { LT_LOAD_ONLY: 'en,fr,ja' }
Options: base_uri (required: the site's server), api_key (by reference, for a server started
with --api-keys, libretranslate.com's paid plans among them), files (false for a server started
with --disable-files-translation), timeout; policy (write the server's --req-limit there),
usage.
Policy (policy.json, read on 2026-11-10): software, not a service: no limit but the operator's, commercial use allowed, no attribution, the operator keeps or not what it receives. The public libretranslate.com needs a paid key; no public mirror says it may be called by a program, so the tests make no live call.
See docs/index.md. MIT licence.