Translate content items with CLI¶
For the purposes of batch processing, automation, and other scripted actions, the Translations management package exposes a command that automatically translates content items or products by using any of the configured providers:
1 2 3 4 5 | |
Command alias
You can use ibexa:translations:translate-content as an alias.
The command uses the same provider configuration and field value transformers as the UI. Therefore, depending on the specific command options used, the result can be the same as if an editor triggered the automated translation manually.
Without the --draft-only option, the translation generated with a CLI command is instantly published, while a manual one requires that a human publishes it.
CLI command options¶
| Option | Required | Description |
|---|---|---|
--content-id |
Yes | ID of the content item or product to translate |
--provider |
Yes | Identifier of the translation provider to use |
--from |
Yes | Source language code |
--to |
Yes | Target language code |
--user-id |
No | Repository user ID to run the translation (default: 14, which is the Administrator user) |
--draft-only |
No | Create a translated draft without publishing it |