Test (a)symmetric XB field translations with revisions, pending revisions and content_moderation/workflows

Created on 21 August 2024, 4 months ago

Overview

We added explicit tests for (a)symmetric translations in πŸ“Œ Allow Experience Builder fields to support Asymmetric and Symmetric translations Needs review β€” yay!

But @Berdir posted a very insightful comment at #3454257-26: Allow Experience Builder fields to support Asymmetric and Symmetric translations β†’ , which points out that the real challenges with translations only begin when translations are combined with revisions. Quoting verbatim:

Not caught up on the whole discussion or experience builder storagae in general. I do want to add that the real complexity around translations starts to show when you add pending revisions, aka content_moderation/workflows to the mix. Because that's when you need to start to merge revision data on a per-field or even field-property (in case of ERR/paragraphs, in this case on whatever partial thingies you store/define here).

See also https://berdir.github.io/entities-explained/#/7/4 and slides before and after that.

Mostly an issue for symmetric translations. As an example, assume you have a thing that has a translatable text field, a partially translated image field (file id is synced, alt/title is per-translation) and an untranslatable list/reference field. You might create 3 draft translations in parallel for different languages and at the same time also change the untranslatable list field in the default translation. Then you publish all those in order and the resulting revision should then contain all translations and the untranslatable value from the default translations.

You don't need to and very likely don't want to support that complexity in this initial issue, but it needs to be on the radar, because this is is how content on multilingual sites works (you need to prepare changes on multiple languages and publish them all basically together). Paragraphs/ERR supports this fairly well, getting as far as we are was a large amount of work but people are still struggling with a number of scenarios (for example ✨ Draft translations should be based on the latest revision of the source language, not the published version Needs work and there are several open issues in ERR that I'm struggling to understand).

Proposed resolution

  • Write comprehensive tests to ensure all combinations work correctly.
  • If bugs arise, fix them in this MR if feasible, otherwise create follow-ups.

User interface changes

None.

πŸ“Œ Task
Status

Active

Component

Data model

Created by

πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

Sign in to follow issues

Comments & Activities

  • Issue created by @wim leers
  • πŸ‡¨πŸ‡­Switzerland berdir Switzerland
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί
  • πŸ‡ΊπŸ‡ΈUnited States effulgentsia

    the real complexity around translations starts to show when you add pending revisions, aka content_moderation/workflows to the mix. Because that's when you need to start to merge revision data on a per-field or even field-property (in case of ERR/paragraphs, in this case on whatever partial thingies you store/define here)

    I might be naive, but I don't think that XB will run into the same problems here that ERR/Paragraphs has because XB (SDC) component instances aren't their own entities. So we don't need to support the concept of some static prop values being translatable and others not, like Paragraphs needs to do. For XB component instance prop values that are sourced from the host entity's fields, those host entity fields can be translatable or not, but that's all managed by the host entity without XB introducing anything new as far as that goes.

    However, once 🌱 [META] Support component types other than SDC Needs work adds support for XB to host Paragraph entities as components, then we'll need to figure out how to do that in a way that matches Paragraphs module's behaviors with respect to translations. I'm hoping we can do that by delegating all of those complexities to the ERR and Paragraphs modules rather than XB introducing anything unique with respect to how the Paragraph entities/revisions/translations get managed.

    Meanwhile, yeah, it still makes sense for this issue to add test coverage for pending revision translations of the XB field as a whole.

Production build 0.71.5 2024