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

On this page you can find all versions of the php package cyllene-digital/sylius-ai-translation-plugin. 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 sylius-ai-translation-plugin

Sylius AI Translation Plugin

Latest version Build Security

Back-office integration of the AI translation engine for Sylius 2: browse the project's translation catalogues, override any wording at runtime (per sales channel if needed), and let AI providers suggest the missing translations, with a per-channel context for the AI, under human review, always.


Translation management: channel selector, coverage per locale, catalogue browsing, overrides of the channel or inherited from the global ones

AI suggestions: generation with a volume estimate, human review of the pending suggestions, journal of the last runs

Compatibility

Component Versions
PHP ^8.3 (Symfony 8: ^8.4)
Sylius 2.1, 2.2, 2.3
Symfony ^7.4, or ^8.0 with Sylius 2.3
cyllene-digital/ai-translation-bundle ^2.0

In a Symfony 7.4 project, pin the stack with extra.symfony.require: "7.4.*" (standard Flex practice): without it Composer may mix Symfony 8 components (symfony/var-exporter…) into a 7.4 framework, which breaks Doctrine proxy generation at boot.

What this plugin does

Two admin screens plugged into the standard Sylius layout (menu, twig hooks, admin firewall):

Two properties matter more than the rest:

No file is ever written. Overrides are database deltas applied over the compiled catalogues: they survive redeployments and immutable containers, the original value is always one click away, and removing an override restores the inherited or file value instantly. A regional locale inherits its language's overrides too (fr_FR falls back on fr), and the screens say where an inherited value comes from.

Nothing AI-generated is applied without a human. Generation produces pending suggestions; only an explicit approval turns one into an override, kept with who approved it and when; a rejected suggestion is deleted. A placeholder guard blocks approvals that would break ICU/%name% parameters.

What this plugin does not do

Installation

With Symfony Flex, the recipes do steps 1 and 2 and copy a commented config/packages/cyllene_digital_ai_translation.yaml: go to step 3. Without Flex, follow every step.

  1. Register the engine, then the plugin after it:

  2. Import the admin routes:

  3. Configure the engine under its cyllene_digital_ai_translation key (providers, translations_path, default_locale, llm_context…) - in the file the recipe copied, or one you create without Flex.

  4. Version the engine tables in your migrations: the engine ships its Doctrine mapping, not migrations (re-run the diff after updating it, too):

  5. Import the plugin's admin entrypoint from yours, then build your assets. It carries the stylesheet and the Stimulus controllers of both screens: without it they render unstyled and the modals, the cost estimate and the channel selector stay inert.

  6. Grant the roles the screens require: without one they answer 403 and the menu entry is not shown. Everything to every admin, or one role per kind of action (permissions):

Every step in detail, with and without Flex: installation.

In production

Generation runs asynchronously on the engine's own Messenger transport: keep a worker on bin/console messenger:consume cyllene_ai_translation. The plugin dispatches the runs on its own bus (cyllene_digital_ai_translation.bus), not on sylius.command_bus: that one wraps handlers in doctrine_transaction, and a failing chunk would roll back the suggestions already billed. Dispatch GenerateSuggestionsMessage yourself? Use that bus too.

A generation sent twice is queued twice, and bills a key once as long as its suggestion waits for a review: the engine runs one generation at a time per catalogue, target locale and channel, and skips every key that already has a pending suggestion. That guard is a symfony/lock lock, whose default store is local to one machine: workers spread over several hosts need a shared store (framework.lock). When the store cannot be reached, the engine logs a warning and runs the generation unguarded: two concurrent runs can then both call the provider; the database stops the one that reserves a key the other holds, before that run pays for its chunk. A key is billed again in two cases: its suggestion was reviewed in between and the run still covers it (a rejected one, or any key of an "All keys" run), or the run is a "Retry errors" one, which re-sends the keys whose previous run failed for as long as they fail. A run for a channel deleted since it was queued bills nothing: the engine refuses it before calling the provider. A run whose channel is deleted while it runs stops before its next chunk, journaled as a failure: only the chunk already with the provider is billed.

Deleting a channel from the admin purges its overrides, suggestions and prompt context, once the deletion is committed; the journal of its generations stays. A purge that fails is logged; what it left, and what a channel deleted another way (a script, Sylius' API, SQL) or with plugin 1.0.x keeps, is purged by bin/console cyllene:ai-translation:purge-scopes --force (without --force, it only lists them). The command only sees the codes no channel uses any more: a channel created again under the code finds those rows.

Keep the cyllene_ai_translation transport asynchronous: a run executed inside a request keeps the channels as it first read them in that request, does not stop when its channel is deleted, and goes on billing its next chunks, stored under the deleted code.

The engine keeps the translation files it parses in the cyllene_digital_ai_translation.translation_files_cache pool, keyed by their path and content: a file rewritten in place is read again at once. A new symfony/translation release that parses a file differently is only seen once the cached entry expires (seven days by default): empty the pool with bin/console cache:pool:clear cyllene_digital_ai_translation.translation_files_cache. cache:clear does not empty it when APP_SHARE_DIR is set (the Symfony 7.4 and 8 skeletons).

An uploaded import waits for its confirmation, one hour at most, in the cyllene_digital_sylius_ai_translation.import_staging cache pool, built on cache.app. Behind a load balancer, the confirmation only finds the upload if that cache is shared between the nodes (Redis…), or point the pool itself at a shared adapter:

Troubleshooting

Symptom Cause
Both screens render unstyled, the modals and the cost estimate do nothing The admin entrypoint is not imported, or the assets were not rebuilt (assets)
The screens answer 403, or the Translations menu entry is missing No role of the plugin is granted (permissions)
A generation is queued and no suggestion arrives No worker consumes cyllene_ai_translation; a run that failed shows in the journal under the list
Cannot reorder children, order does not contain all children. The project reorders its admin menu with a fixed list (menu)
An import file is refused for its size although it is under 8 MB PHP accepts less (upload_max_filesize, post_max_size): the import window announces the limit that really applies
An import is refused as expired right after the upload The upload and its confirmation were served by two nodes that do not share cache.app (see In production)

Upgrading

Every compatibility break is written in UPGRADE.md before it is released, with the steps to carry out. The engine has its own upgrade guide.

Public contract

The bundle class, the admin routes, the Twig hooks and templates, the grids, the roles, the menu entry and the generation bus only change in a major version. The full list, what is internal and the support policy: public contract.

Documentation

Status

Exercised on a real Sylius 2.3 back office: the functional tests boot the plugin inside the Sylius test application against a real database, log an admin in and drive both screens through the HTTP kernel, the suggestion workflow included.

The continuous integration matrix runs the unit, integration and functional tests, 46 Behat scenarios (14 of them in headless Chrome, on the primary combination; 12 reading the result in the shop), PHPStan at max level, the coding standard, container, template and translation linting and a strict composer validate on PHP 8.3, 8.4 and 8.5, against Sylius 2.1, 2.2 and 2.3 on MySQL 8.4 - and, on the primary combination, on MySQL 8.0, MariaDB 10.11 and 11.4, PostgreSQL 15, 16 and 17.

Both screens are driven by a channel filter: coverage, counters, browsing, suggestion generation and review all happen for the selected channel (or globally).

Contributing

CONTRIBUTING.md - setting up the test environment, standards, what has to pass.

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

Provenance and licence

Released under the MIT licence: see LICENSE.


Package: cyllene-digital/sylius-ai-translation-plugin

Maintained by Cyllene, on GitHub as @CylleneDigital


All versions of sylius-ai-translation-plugin with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-intl Version *
cyllene-digital/ai-translation-bundle Version ^2.0
doctrine/persistence Version ^3.1 || ^4.0
pagerfanta/core Version ^3.7 || ^4.0
psr/cache Version ^3.0
psr/clock Version ^1.0
sylius/sylius Version ^2.1
symfony/cache Version ^7.4 || ^8.0
symfony/clock Version ^7.4 || ^8.0
symfony/config Version ^7.4 || ^8.0
symfony/dependency-injection Version ^7.4 || ^8.0
symfony/doctrine-bridge Version ^7.4 || ^8.0
symfony/form Version ^7.4 || ^8.0
symfony/framework-bundle Version ^7.4 || ^8.0
symfony/http-foundation Version ^7.4 || ^8.0
symfony/http-kernel Version ^7.4 || ^8.0
symfony/messenger Version ^7.4 || ^8.0
symfony/routing Version ^7.4 || ^8.0
symfony/security-bundle Version ^7.4 || ^8.0
symfony/security-csrf Version ^7.4 || ^8.0
symfony/serializer Version ^7.4 || ^8.0
symfony/service-contracts Version ^3.5
symfony/translation-contracts Version ^3.5
symfony/validator Version ^7.4 || ^8.0
symfony/yaml Version ^7.4 || ^8.0
twig/twig Version ^3.10
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/sylius-ai-translation-plugin contains the following files

Loading the files please wait ...