Download the PHP package cyllene-digital/ai-translation-bundle without Composer

On this page you can find all versions of the php package cyllene-digital/ai-translation-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ai-translation-bundle

AI Translation Bundle

Latest version Build Security

A Symfony bundle to edit your application's translations at runtime: overrides are stored in the database and applied on top of your translations/ files, which are never modified, and AI suggestions fill the missing keys, applied only once a human approves them.

It is an engine without user interface: a console and a PHP API, on which any application can build its own screens.

Compatibility

Component Versions
PHP ^8.3
Symfony ^7.4 \|\| ^8.0
Doctrine ORM ^3.5 (DBAL 3 or 4)
Database MySQL, MariaDB, PostgreSQL, SQLite
PHP extensions dom, libxml; intl recommended: without it, ICU overrides are served as stored and an invalid ICU pattern is not caught at save time

An API key for at least one AI provider (OpenAI, Anthropic, DeepL, or any OpenAI-compatible server such as Mistral or a local Ollama) is needed for the suggestions; the overrides work without.

What this bundle does

Installation

The Flex recipe registers the bundle and adds a commented config/packages/cyllene_digital_ai_translation.yaml (it is a contrib recipe: answer "yes" when Flex asks, or set "allow-contrib": true under extra.symfony once and for all). Without Flex:

The bundle ships its entity mapping, not migrations: generate one in your application (with doctrine/doctrine-migrations-bundle; doctrine:schema:update does without it):

Run the diff again after each bundle update: a mapping change needs its own migration.

On DBAL 3, set doctrine.dbal.use_savepoints: true (why).

Configuration

The minimal configuration declares one AI provider:

Every other key (translations path, default locale, extra translation roots, AI context, cache TTLs) has a default: configuration reference. Each provider type has its own page: provider bridges.

How to start

  1. Open the console, a menu of guided tasks: browse and edit translations, generate and review suggestions, import, export, coverage.

  2. Generate suggestions for a locale, the cost estimate first, then for real:

  3. Review them in the console ("Review the pending suggestions"): approving one writes the override, served right away; it writes nothing when the entry already shows that value, and removes the stored override when the approved value is the one the entry falls back to.

  4. Check the coverage, in CI if you like (--min=95 fails under 95 %):

Every command and its options: docs/operations/commands.md.

Synchronous vs asynchronous generation

Synchronous generation (default)

Out of the box, generation is synchronous: it runs where it is called, with nothing more to install or configure. That is how the console works: cyllene:ai-translation and generate run the generation in the command, show its progress and return a meaningful exit code.

Asynchronous generation

To run generation in a worker instead, add the Doctrine transport:

The bundle then configures the rest itself: a cyllene_ai_translation transport (a queue in your database, never retried: a retry would bill the provider twice), with GenerateSuggestionsMessage routed to it.

From your code, dispatch one message per catalogue and target locale:

Dispatch it on a bus without the doctrine_transaction middleware. Sylius' default bus has it, and a run inside a transaction is refused: a rollback would discard suggestions the provider has already billed. Never on a transactional bus shows a dedicated bus.

And run a worker:

The console stays synchronous either way: it never dispatches the message. Another broker (RabbitMQ, Redis…), your own routing, the failure transport and multi-server locks: configuration reference.

Documentation

Page What it covers
Index The reading guide: concepts, bridges, operations, decision records
Overrides The decorated translator, scopes, the cache layers, automatic invalidation
Catalogues The scan, additional roots, the same-language fallback chain, what "missing" means
Coverage The default locale, what counts as translated, the CI gate, the invisible drift
Suggestions Lifecycle, idempotent generation, the placeholder guard, the audit trail
Manual override Editing one translation: the four doors, save guarantees, orphans
Scopes Per-site/brand/channel values, shadowing order, the host-side provider
Configuration reference Every cyllene_digital_ai_translation key, type and default
Provider bridges default / openai / anthropic / deepl / custom: options, wire formats, error behaviour
CLI commands Every command with its options
Caches What is invalidated automatically, multi-server and worker setups
Running on several servers The shared cache pool and lock store a multi-node deployment needs
Doctrine DBAL 3 The savepoints setting a DBAL 3 host needs, and why
Decision records Why the bundle is built the way it is, one decision per file

Extending

Every strategic decision can be replaced or observed from the host application, without touching the bundle's code. All classes below live under CylleneDigital\AiTranslationBundle\.

Contributing

CONTRIBUTING.md: running the test suite, standards, what has to pass.

A security flaw is reported privately: SECURITY.md. Do not open it as a public issue.

Provenance and licence

Released under the MIT licence (see LICENSE). Model prices for the cost estimate come from the public LiteLLM price list, fetched at runtime.


Package: cyllene-digital/ai-translation-bundle

Maintained by Cyllene, on GitHub as @CylleneDigital


All versions of ai-translation-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-dom Version *
ext-libxml Version *
doctrine/dbal Version ^3.9 || ^4.3
doctrine/doctrine-bundle Version ^2.13 || ^3.1
doctrine/orm Version ^3.5
doctrine/persistence Version ^3.1 || ^4.0
psr/log Version ^3.0
symfony/cache Version ^7.4 || ^8.0
symfony/cache-contracts Version ^3.6
symfony/clock Version ^7.4 || ^8.0
symfony/config Version ^7.4 || ^8.0
symfony/console Version ^7.4 || ^8.0
symfony/dependency-injection Version ^7.4 || ^8.0
symfony/event-dispatcher Version ^7.4 || ^8.0
symfony/filesystem Version ^7.4 || ^8.0
symfony/framework-bundle Version ^7.4 || ^8.0
symfony/http-client Version ^7.4 || ^8.0
symfony/http-client-contracts Version ^3.6
symfony/http-kernel Version ^7.4 || ^8.0
symfony/lock Version ^7.4 || ^8.0
symfony/messenger Version ^7.4 || ^8.0
symfony/translation Version ^7.4 || ^8.0
symfony/yaml Version ^7.4 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cyllene-digital/ai-translation-bundle contains the following files

Loading the files please wait ...