Skip to content

IBX-11539: Translation hub developer docs - #3518

Open
dabrt wants to merge 14 commits into
translation-hub-product-guidefrom
translation-hub-dev-docs
Open

dabrt wants to merge 14 commits into
translation-hub-product-guidefrom
translation-hub-dev-docs

Conversation

@dabrt

@dabrt dabrt commented Dec 3, 2026

Copy link
Copy Markdown
Contributor
Question Answer
JIRA Ticket IBX-11539
Versions 6.0
Edition n/a

Configuration (background worker, pagination, notifications)
Events, notification types limitations
PHP API, REST API, and console commands

Checklist

  • Text renders correctly
  • Text has been checked with vale
  • Description metadata is up to date
  • Redirects cover removed/moved pages
  • Code samples are working
  • PHP code samples have been fixed with PHP CS fixer

@dabrt
dabrt changed the base branch from 5.0 to translation-hub-product-guide December 3, 2026 17:25
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Summary

Status Count
🔍 Total 755218
🔗 Unique 15033
✅ Successful 6446
⏳ Timeouts 0
🔀 Redirected 8
👻 Excluded 748753
❓ Unknown 0
🚫 Errors 19
⛔ Unsupported 0

Errors per input

Errors in site/content_management/content_management_guide/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html (at 14758:50) | File not found. Check if file exists and path is correct

Errors in site/ibexa_products/editions/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html (at 14390:14) | File not found. Check if file exists and path is correct

Errors in site/ibexa_products/ibexa_commerce/index.html

Errors in site/ibexa_products/ibexa_experience/index.html

Errors in site/ibexa_products/ibexa_headless/index.html

Errors in site/multisite/languages/languages/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html (at 14429:27) | File not found. Check if file exists and path is correct

Errors in site/translations_management/configure_translations_management/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html#add-translations (at 14754:25) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html#manage-translation-services-and-language-pairs (at 14758:17) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html#side-by-side-translation-view (at 14886:17) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html#side-by-side-translation-view (at 14895:109) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translation_analytics/index.html#provider-statistics (at 14773:80) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translations_hub/index.html (at 14760:13) | File not found. Check if file exists and path is correct

Errors in site/translations_management/extend_translations_management/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/bulk_translations/index.html#track-bulk-translation-jobs (at 14539:62) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translation_analytics/index.html#provider-statistics (at 14539:243) | File not found. Check if file exists and path is correct

Errors in site/translations_management/translations_management_api/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html#add-translations (at 15034:112) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translations_hub/index.html#permissions (at 14451:36) | File not found. Check if file exists and path is correct

Errors in site/translations_management/translations_management_guide/index.html

  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html#review-automatic-translation (at 14749:22) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translate_content/index.html#side-by-side-translation-view (at 14729:50) | File not found. Check if file exists and path is correct
  • [ERROR] file:///home/runner/work/documentation-developer/documentation-developer/repositories/userdoc-6.0/site/translations/translations_hub/index.html#permissions (at 14764:64) | File not found. Check if file exists and path is correct

Redirects per input

Redirects in site/getting_started/install_with_ddev/index.html

Redirects in site/ibexa_products/ibexa_commerce/index.html

Redirects in site/ibexa_products/ibexa_experience/index.html

Redirects in site/ibexa_products/ibexa_headless/index.html

Redirects in site/infrastructure_and_maintenance/clustering/clustering_with_ddev/index.html

Redirects in site/release_notes/ibexa_dxp_v5.0/index.html

Full Github Actions output

dabrt and others added 4 commits December 3, 2026 19:03
- Missing tab lists items without a published version in the target language
- default provider when no language pair matches; jobs without a provider
- keeping drafts when deleting an unfinished job
- link permissions to the Translations hub section of the user documentation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Configuration (background worker, pagination, notifications) merged into
Configure translations management; PHP API, REST API, and console commands
in the new Translations management API page; events and notification types.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ST API

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dabrt
dabrt force-pushed the translation-hub-dev-docs branch from 047857c to 1feebf7 Compare December 3, 2026 18:06
dabrt added 3 commits December 3, 2026 19:16
Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
@dabrt
dabrt marked this pull request as ready for review December 3, 2026 18:45
@dabrt
dabrt force-pushed the translation-hub-product-guide branch from e330a3e to e0cec3b Compare December 3, 2026 18:46
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

code_samples/ change report

Before (on target branch)After (in current PR)

code_samples/translations_management/src/Command/BulkTranslationJobsCommand.php


code_samples/translations_management/src/Command/BulkTranslationJobsCommand.php

docs/translations_management/translations_management_api.md@74:``` php
docs/translations_management/translations_management_api.md@75:[[= include_file('code_samples/translations_management/src/Command/BulkTranslationJobsCommand.php') =]]
docs/translations_management/translations_management_api.md@76:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Command;
006⫶
007⫶use Ibexa\Contracts\Core\Repository\PermissionResolver;
008⫶use Ibexa\Contracts\Core\Repository\UserService;
009⫶use Ibexa\Contracts\TranslationsManagement\AutoTranslate\AutoTranslationReviewOperation;
010⫶use Ibexa\Contracts\TranslationsManagement\AutoTranslate\AutoTranslationReviewStatus;
011⫶use Ibexa\Contracts\TranslationsManagement\BulkTranslations\JobServiceInterface;
012⫶use Ibexa\Contracts\TranslationsManagement\BulkTranslations\Values\JobItem;
013⫶use Ibexa\Contracts\TranslationsManagement\BulkTranslations\Values\JobItemQuery;
014⫶use Ibexa\Contracts\TranslationsManagement\BulkTranslations\Values\JobItemStatus;
015⫶use Ibexa\Contracts\TranslationsManagement\BulkTranslations\Values\JobQuery;
016⫶use Ibexa\Contracts\TranslationsManagement\BulkTranslations\Values\JobStatus;
017⫶use Symfony\Component\Console\Attribute\AsCommand;
018⫶use Symfony\Component\Console\Command\Command;
019⫶use Symfony\Component\Console\Input\InputArgument;
020⫶use Symfony\Component\Console\Input\InputInterface;
021⫶use Symfony\Component\Console\Input\InputOption;
022⫶use Symfony\Component\Console\Output\OutputInterface;
023⫶
024⫶#[AsCommand(
025⫶ name: 'doc:translations_hub:jobs'
026⫶)]
027⫶final class BulkTranslationJobsCommand extends Command
028⫶{
029⫶ public function __construct(
030⫶ private readonly JobServiceInterface $jobService,
031⫶ private readonly PermissionResolver $permissionResolver,
032⫶ private readonly UserService $userService
033⫶ ) {
034⫶ parent::__construct();
035⫶ }
036⫶
037⫶ protected function configure(): void
038⫶ {
039⫶ $this
040⫶ ->addArgument('user', InputArgument::OPTIONAL, 'Login of the user to act as', 'admin')
041⫶ ->addOption('retry', null, InputOption::VALUE_NONE, 'Retry the failed items of finished jobs')
042⫶ ->addOption('approve', null, InputOption::VALUE_REQUIRED, 'ID of a job whose translations to approve');
043⫶ }
044⫶
045⫶ #[\Override]
046⫶ protected function execute(
047⫶ InputInterface $input,
048⫶ OutputInterface $output
049⫶ ): int {
050⫶ $user = $this->userService->loadUserByLogin((string) $input->getArgument('user'));
051⫶ $this->permissionResolver->setCurrentUserReference($user);
052⫶
053⫶ $jobs = $this->jobService->findBulkTranslationJobs(new JobQuery(
054⫶ limit: 10,
055⫶ statuses: [JobStatus::STATUS_FOR_REVIEW, JobStatus::STATUS_FAILED]
056⫶ ));
057⫶ $output->writeln(sprintf('Jobs waiting for review or failed: %d', $jobs->totalCount));
058⫶
059⫶ foreach ($jobs as $job) {
060⫶ $output->writeln(sprintf(
061⫶ '#%d %s (%s): %d of %d items translated, %d failed',
062⫶ $job->id,
063⫶ $job->title ?? 'Untitled',
064⫶ implode(', ', $job->targetLanguageCodes),
065⫶ $job->successfulItems,
066⫶ $job->totalItems,
067⫶ $job->failedItems
068⫶ ));
069⫶
070⫶ $failedItems = $this->jobService->findJobItems(
071⫶ new JobItemQuery(jobId: $job->id, status: JobItemStatus::STATUS_FAILED)
072⫶ );
073⫶ foreach ($failedItems as $failedItem) {
074⫶ $output->writeln(sprintf(' Failed: %s (content ID %d)', $failedItem->contentName, $failedItem->contentId));
075⫶ }
076⫶
077⫶ if ($input->getOption('retry') && $job->isRetryable()) {
078⫶ $this->jobService->retryBulkTranslationJob($job->id);
079⫶ $output->writeln(' Failed items queued for another translation attempt.');
080⫶ }
081⫶ }
082⫶
083⫶ $jobToApprove = $input->getOption('approve');
084⫶ if ($jobToApprove !== null) {
085⫶ $itemsForReview = $this->jobService->findJobItems(new JobItemQuery(
086⫶ jobId: (int) $jobToApprove,
087⫶ limit: 100,
088⫶ reviewStatus: AutoTranslationReviewStatus::STATUS_FOR_REVIEW
089⫶ ));
090⫶ $jobItemIds = array_map(
091⫶ static fn (JobItem $jobItem): int => $jobItem->id,
092⫶ $itemsForReview->items
093⫶ );
094⫶
095⫶ if ($jobItemIds !== []) {
096⫶ $this->jobService->reviewBulkTranslationJobItems(
097⫶ $jobItemIds,
098⫶ AutoTranslationReviewOperation::OPERATION_APPROVED
099⫶ );
100⫶ }
101⫶ $output->writeln(sprintf('Approved translations: %d', count($jobItemIds)));
102⫶ }
103⫶
104⫶ return self::SUCCESS;
105⫶ }
106⫶}


code_samples/translations_management/src/Command/TranslationsHubOverviewCommand.php


code_samples/translations_management/src/Command/TranslationsHubOverviewCommand.php

docs/translations_management/translations_management_api.md@54:``` php
docs/translations_management/translations_management_api.md@55:[[= include_file('code_samples/translations_management/src/Command/TranslationsHubOverviewCommand.php') =]]
docs/translations_management/translations_management_api.md@56:```

001⫶<?php
002⫶
003⫶declare(strict_types=1);
004⫶
005⫶namespace App\Command;
006⫶
007⫶use Ibexa\Contracts\Core\Repository\PermissionResolver;
008⫶use Ibexa\Contracts\Core\Repository\UserService;
009⫶use Ibexa\Contracts\Core\Repository\Values\Content\Content;
010⫶use Ibexa\Contracts\TranslationsManagement\Analytics\Query\TranslationCoverageQuery;
011⫶use Ibexa\Contracts\TranslationsManagement\Analytics\TranslationCoverageProviderInterface;
012⫶use Ibexa\Contracts\TranslationsManagement\BulkTranslations\ContentDiscoveryQuery;
013⫶use Ibexa\Contracts\TranslationsManagement\BulkTranslations\ContentDiscoveryServiceInterface;
014⫶use Symfony\Component\Console\Attribute\AsCommand;
015⫶use Symfony\Component\Console\Command\Command;
016⫶use Symfony\Component\Console\Input\InputArgument;
017⫶use Symfony\Component\Console\Input\InputInterface;
018⫶use Symfony\Component\Console\Output\OutputInterface;
019⫶
020⫶#[AsCommand(
021⫶ name: 'doc:translations_hub:overview'
022⫶)]
023⫶final class TranslationsHubOverviewCommand extends Command
024⫶{
025⫶ public function __construct(
026⫶ private readonly TranslationCoverageProviderInterface $coverageProvider,
027⫶ private readonly ContentDiscoveryServiceInterface $contentDiscoveryService,
028⫶ private readonly PermissionResolver $permissionResolver,
029⫶ private readonly UserService $userService
030⫶ ) {
031⫶ parent::__construct();
032⫶ }
033⫶
034⫶ protected function configure(): void
035⫶ {
036⫶ $this
037⫶ ->addArgument('languageCode', InputArgument::REQUIRED, 'Target language code, for example ger-DE')
038⫶ ->addArgument('user', InputArgument::OPTIONAL, 'Login of the user to check the content as', 'admin');
039⫶ }
040⫶
041⫶ #[\Override]
042⫶ protected function execute(
043⫶ InputInterface $input,
044⫶ OutputInterface $output
045⫶ ): int {
046⫶ $user = $this->userService->loadUserByLogin((string) $input->getArgument('user'));
047⫶ $this->permissionResolver->setCurrentUserReference($user);
048⫶
049⫶ $languageCode = (string) $input->getArgument('languageCode');
050⫶
051⫶ $coverageList = $this->coverageProvider->getTranslationCoverage(
052⫶ new TranslationCoverageQuery(languageCodes: [$languageCode])
053⫶ );
054⫶ $coverage = $coverageList->getForLanguage($languageCode);
055⫶ if ($coverage !== null) {
056⫶ $output->writeln(sprintf(
057⫶ '%s: %d of %d content items translated (%.1f%%), %d missing, %d outdated',
058⫶ $coverage->languageCode,
059⫶ $coverage->translatedItems,
060⫶ $coverage->targetItems,
061⫶ $coverage->coverageRatio * 100,
062⫶ $coverage->missingItems,
063⫶ $coverage->staleItems
064⫶ ));
065⫶ }
066⫶
067⫶ $missingTranslations = $this->contentDiscoveryService->findMissingTranslations(
068⫶ new ContentDiscoveryQuery(targetLanguageCode: $languageCode, limit: 10)
069⫶ );
070⫶ $output->writeln(sprintf('Content items without a %s translation: %d', $languageCode, $missingTranslations->totalCount));
071⫶ foreach ($missingTranslations->searchHits as $searchHit) {
072⫶ $content = $searchHit->valueObject;
073⫶ if ($content instanceof Content) {
074⫶ $output->writeln(sprintf('- %s (ID %d)', $content->getName(), $content->getId()));
075⫶ }
076⫶ }
077⫶
078⫶ return self::SUCCESS;
079⫶ }
080⫶}

Download colorized diff

```

If the worker doesn't run, new jobs stay in the "Pending" state.
Only one job per target language can be pending or in progress, therefore editors can't start another job for that language.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Only one job per target language can be pending or in progress, therefore editors can't start another job for that language.
A job can have one or more target languages; only one job per target language can be pending or in progress at a time.

| `GET` | `/job/{id}` | Get the summary of a job |
| `GET` | `/job/{id}/items` | List the items of a job |
| `POST` | `/job/{id}/retry` | Retry the failed items of a job |
| `DELETE` | `/job/{id}` | Remove a job |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| `DELETE` | `/job/{id}` | Remove a job |
DELETE /job/{id}?keepDrafts=true|false - keepDrafts=true only works for partially created jobs.

- `reviewBulkTranslationJobItems()` approves or rejects the translations of many job items at once
- `retryBulkTranslationJob()` translates the failed items of a finished job again
- `retranslateJobItem()` translates a single item of a finished job again, and removes its previous draft
- `removeBulkTranslationJob()` removes a job together with the drafts that it created, or cancels it first if it's pending or in progress

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method signature includes a second $keepDrafts argument.

Full deletion logs bulk_translation_removed, while partial deletion logs bulk_translation_part_removed with remainingItems.

The BulkTranslationJobRemovedEvent event also contains remainingItems.

What needs to be updated in the PR:

  1. Add the keepDrafts argument to the list of method arguments.
  2. In the Events section, mention that remainingItems = 0 indicates a full deletion.


$jobs = $this->jobService->findBulkTranslationJobs(new JobQuery(
limit: 10,
statuses: [JobStatus::STATUS_FOR_REVIEW, JobStatus::STATUS_FAILED]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A job has one of the following statuses, defined in JobStatus: pending, in_progress, for_review, completed, failed, or cancelled.
A job is cancelled when you remove it while it's pending or in progress.
Items of a job use JobItemStatus: pending, in_progress, completed, failed, cancelled, or not_created.


- `findBulkTranslationJobs()` and `countBulkTranslationJobs()` find jobs by status, target language, creator, or title, by using a [`JobQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-BulkTranslations-Values-JobQuery.html)
- `getBulkTranslationJob()` loads a job by its ID
- `findJobItems()` lists the items of a job, optionally filtered by item status, review status, target language, or content type, by using a [`JobItemQuery`](/api/php_api/php_api_reference/classes/Ibexa-Contracts-TranslationsManagement-BulkTranslations-Values-JobItemQuery.html)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The backend has a published status, but published items are excluded from the For review and Translated queues. The published status is visible only in job/{id}/items.

What needs to be updated in the PR:
In the ReviewItemServiceInterface description, add:
Published translations are not returned.

| `GET` | `/translated` | List accepted translations that aren't published yet |
| `GET` | `/translated/filters` | List the filter choices of the accepted translations list |
| `POST` | `/translated/bulk-delete` | Delete the drafts of many accepted translations |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commands and REST API documentation do not currently describe the retranslate behavior.
What needs to be updated in the PR:

  1. In the REST table, add: 409 when the content is in the trash.
  2. In the retranslateJobItem() description, clarify: The job returns to the For review status.

[[= include_file('code_samples/translations_management/src/Command/TranslationsHubOverviewCommand.php') =]]
```

### Work with bulk translation jobs

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a paragraph to Work with bulk translation jobs describing trashed item behavior:

  • Trashed items do not count as failed or awaiting review.
  • A job can reach completed even if it contains trashed items.
  • Restoring an item from the trash triggers job recalculation.
  • /job/{id}/items exposes removed and errorCode (content_removed or content_restored).

@@ -0,0 +1,212 @@
---

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add please:
When an item fails, its reason is one of the TranslationFailureReason values, returned as errorCode by the REST API. It's the reason of the last attempt, and it stays until the item is retried. Whether the content item is in the trash now is a separate removed flag.

Comment on lines +258 to +270

``` yaml
ibexa:
system:
admin_group:
translations_management:
bulk_translations:
pagination:
missing_limit: 25
missing_allowed_limits: [25, 50, 100, 200]
```

The following settings are available, all with the default limit of 10 and the default allowed limits of 10, 25, 50, and 100:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bug has been reported: https://ibexa.atlassian.net/jira/browse/IBX-13454
If the fix won't be included in this release, a note must be added to the docs:
The back office applies these settings only to the Missing tab; the REST API applies them to all lists.

@KamilSznajdrowicz KamilSznajdrowicz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With https://github.com/ibexa/translations-management/pull/556 (IBX-13425), the user who starts a bulk translation job also needs the content/versionread policy, including for jobs without a provider. Without it, every job item fails with "permission_denied", also for always-available content, which used to work on 6.0.
Please add content/versionread to the permissions required for Bulk translations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants