IBX-10684: Document translation management - #3249
Conversation
Co-Authored-By: dabrt <dabrt@users.noreply.github.com> Co-Authored-By: Marek Nocoń <mnocon@users.noreply.github.com>
code_samples/ change report
|
Co-authored-by: Tomasz Kryszan <tomasz.kryszan@ibexa.co>
Co-authored-by: Tomasz Kryszan <tomasz.kryszan@ibexa.co> Co-authored-by: Tomasz Dąbrowski <64841871+dabrt@users.noreply.github.com>
Co-authored-by: Tomasz Kryszan <tomasz.kryszan@ibexa.co>
mnocon
left a comment
There was a problem hiding this comment.
Review without the "Extend..." article (will do the review of it soon)
| app.translations_management.exclusion_rule.custom_field_types: | ||
| class: Ibexa\TranslationsManagement\SideBySide\Service\UnsupportedFieldTypeExclusionRule | ||
| arguments: | ||
| $excludedFieldTypeIdentifiers: ['custom_blog_post', 'custom_landing_page'] |
There was a problem hiding this comment.
Both 'custom_blog_post' and 'custom_landing_page' sound more like content types than field types - I'd use the examples we have in other parts in the doc for custom field types (https://doc.ibexa.co/en/5.0/content_management/field_types/create_custom_generic_field_type/#define-value-object , https://doc.ibexa.co/en/5.0/tutorials/generic_field_type/creating_a_point2d_field_type/ )
| $event->getContentId(); | ||
| $event->getFromLanguageCode(); // ?string — null when no source language exists | ||
| $event->getToLanguageCode(); | ||
| $event->getLocationId(); // ?int — null when no location context is available |
There was a problem hiding this comment.
| $event->getLocationId(); // ?int — null when no location context is available | |
| $event->getLocationId(); // ?int — null when the content item hasn't been published yet |
To make it more meaningful - I assume null happens only in this case? That's https://doc.ibexa.co/en/5.0/content_management/locations/#:~:text=A%20content%20item%20receives%20a%20location%20only%20once%20it%20has%20been%20published%2E%20This%20means%20that%20a%20new%20unpublished%20draft%20doesn%27t%20have%20a%20location%20yet%2E%20You%20can%20find%20drafts%20in%20the%20Drafts%20tab%20in%20the%20Content%20menu
| { | ||
| // Read the translation context: | ||
| $event->getContentId(); | ||
| $event->getFromLanguageCode(); // ?string — null when no source language exists |
There was a problem hiding this comment.
| $event->getFromLanguageCode(); // ?string — null when no source language exists | |
| $event->getFromLanguageCode(); // ?string — null when no source language was selected |
|
|
||
| ## Translation events | ||
|
|
||
| Translation events are thrown once per field value per translation operation. |
There was a problem hiding this comment.
| Translation events are thrown once per field value per translation operation. | |
| Translation events are dispatched once per field value per translation operation. |
Exceptions are thrown (throw new InvalidArgumentException), event are dispatched by the event dispatcher ( https://github.com/ibexa/translations-management/blob/9e62c293b8085443c16f10a34de3b089f79b126b/src/lib/AutoTranslate/Event/EventDispatchingProviderTranslator.php#L45 )
I'm not sure I understand this sentence correctly - for each field type to be translated and for each language that field is translated into?
3 fields, 2 languages - 6 before and after events?
How about:
| Translation events are thrown once per field value per translation operation. | |
| Translation events are dispatched for every field in each selected target language. |
| ## Translation events | ||
|
|
||
| Translation events are thrown once per field value per translation operation. | ||
| They are used for logging, analytics, and observability. |
There was a problem hiding this comment.
Are they used, or can they be used?
I think the system uses them only for logging by default (https://github.com/ibexa/translations-management/blob/9e62c293b8085443c16f10a34de3b089f79b126b/src/bundle/AutoTranslate/EventSubscriber/TranslationEventSubscriber.php#L11 ? )
| They are used for logging, analytics, and observability. | |
| Use them for logging, analytics, and observability. |
|
|
||
| Content types that are editable in Page builder or Form builder are excluded from side-by-side editing. | ||
|
|
||
| Products are editable in the side-by-side view, but product attributes are not translatable. |
There was a problem hiding this comment.
Good remark, might be worth to link to the product attributes note explaining this (https://doc.ibexa.co/en/5.0/product_catalog/products/#product-attributes:~:text=Attribute%20translations )
|
|
||
| !!! note "Excluded content types" | ||
|
|
||
| Content types that are editable in Page builder or Form builder are excluded from side-by-side editing. |
There was a problem hiding this comment.
Links to Page Builder and Form Builder?
https://doc.ibexa.co/en/5.0/content_management/pages/pages/ and https://doc.ibexa.co/en/5.0/content_management/forms/forms/ , or the product guides
| !!! note "No review for manual translations" | ||
|
|
||
| Draft translations that were created manually don't have a review status. |
There was a problem hiding this comment.
This seems like a difference - coming back to the mention of "triggering the translation from CLI has the same results as triggering from UI" in another article.
|
|
||
| ## Translation review | ||
|
|
||
| When a draft translation of a content item or product is created by going through the automatic translation process, the system creates a review status record and marks the draft `for_review`. |
There was a problem hiding this comment.
This one doesn't mention that CLI does not trigger it.
| | `--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 | | ||
|
|
||
| ## Translation review |
There was a problem hiding this comment.
This workflow doesn't seem configurable, can we find a better place to describe this than the "Configure..." article?
Document translation management
Checklist