# Translations management events

> For the complete documentation index, see [llms.txt](https://doc.ibexa.co/en/6.0/llms.txt).

Events that are triggered when working with translations management.

Editions: LTS Update

The [Translations management](https://doc.ibexa.co/en/6.0/translations_management/translations_management_guide/index.md) package dispatches events when it translates content, creates side-by-side translation drafts, records translation attempts and review decisions, and runs [bulk translation jobs](https://doc.ibexa.co/en/6.0/translations_management/configure_translations_management/#configure-translations-hub).

\<***>Update the intro: there are now also bulk translation job events.\</***>

## Translation events

Translation events are dispatched for every field in each selected target language. Use them for logging, analytics, and observability. Both events are read-only, you can't use them to override the translation result.

| Event                                                                                                                                                                            | Dispatched by                        | Dispatched when                                      |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ---------------------------------------------------- |
| [`BeforeTranslateEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-AutoTranslate-Event-BeforeTranslateEvent.html) | `EventDispatchingProviderTranslator` | Before a translation request is sent to the provider |
| [`TranslateEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-AutoTranslate-Event-TranslateEvent.html)             | `EventDispatchingProviderTranslator` | After a translation response is received             |

## Side-by-side creation events

Side-by-side creation events are dispatched when preparing a new translation draft.

| Event                                                                                                                                                                                                                   | Dispatched by                        | Dispatched when                                                  |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ---------------------------------------------------------------- |
| [`OnContentSideBySideTranslationCreateEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-SideBySide-Event-OnContentSideBySideTranslationCreateEvent.html) | `ContentTranslationCreateController` | When creating a draft side-by-side translation of a content item |
| [`OnProductSideBySideTranslationCreateEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-SideBySide-Event-OnProductSideBySideTranslationCreateEvent.html) | `ProductTranslationViewController`   | When creating a draft side-by-side translation of a product      |

## Translation attempt events

Translation attempt events are dispatched once for each content item and target language that a translation provider is asked to translate: in the back office, in [bulk translation jobs](https://doc.ibexa.co/en/6.0/translations_management/configure_translations_management/#configure-translations-hub), and with the [console command](https://doc.ibexa.co/en/6.0/translations_management/translations_management_api/#translate-content-items). They implement [`TranslationAttemptEventInterface`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-AutoTranslate-Event-TranslationAttemptEventInterface.html), which gives access to the content ID, the provider identifier, and the source and target language codes. If a listener throws an exception, the exception is logged and doesn't stop the translation.

| Event                                                                                                                                                                                                          | Dispatched when                                                                                                  |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| [`TranslationAttemptSucceededEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-AutoTranslate-Event-TranslationAttemptSucceededEvent.html)       | After the provider translated the content item, also when the translated draft is discarded later                |
| [`TranslationAttemptFailedEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-AutoTranslate-Event-TranslationAttemptFailedEvent.html)             | When the request to the provider failed                                                                          |
| [`TranslationDraftCreationFailedEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-AutoTranslate-Event-TranslationDraftCreationFailedEvent.html) | When the provider translated the content item, but the translated draft or its review status couldn't be created |

## Review events

| Event                                                                                                                                                                                                                  | Dispatched when                                                                                                                                                   |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`AutoTranslationReviewStatusUpdatedEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-AutoTranslate-Event-AutoTranslationReviewStatusUpdatedEvent.html) | After the review status of one or more machine translations changed, for example when a reviewer approved or rejected them, or when the translation was published |

A batch update, such as approving many translations at once, dispatches the event once, with the IDs of all the updated auto-translation records. The event's context identifies the content item or product when the update concerned a single one, and is `null` otherwise.

## Bulk translation events

Bulk translation events are dispatched by the worker that [processes bulk translation jobs](https://doc.ibexa.co/en/6.0/translations_management/configure_translations_management/#process-bulk-translation-jobs-in-background). They're informative: you can't use them to change the job.

| Event                                                                                                                                                                                                     | Dispatched when                                                                            |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [`BulkTranslationJobStartedEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-BulkTranslations-Event-BulkTranslationJobStartedEvent.html)   | When the worker starts processing a pending job                                            |
| [`BulkTranslationJobFinishedEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-BulkTranslations-Event-BulkTranslationJobFinishedEvent.html) | When a job ends with the "For review", "Completed", or "Failed" status, also after a retry |
| [`BulkTranslationJobRemovedEvent`](https://doc.ibexa.co/en/6.0/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-BulkTranslations-Event-BulkTranslationJobRemovedEvent.html)   | When the removal of a job that a user requested ends                                       |

`BulkTranslationJobStartedEvent` isn't dispatched again when a job resumes after the worker stopped, so listeners might miss the start of a job. `BulkTranslationJobFinishedEvent` carries the final status and the number of failed items. `BulkTranslationJobRemovedEvent` carries the number of remaining items: if some drafts couldn't be removed, the job stays listed with these items.
