Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
When adding a new translation, children can be collapsed according to the regular collapse setting.
That setting however is chosen with regular editing in mind.
Proposed resolution
When adding a translation, all Paragraphs should be expanded so that all translatables are visible.
Otherwise a user might translate what is visible, forgets about certain collapsed Paragraphs and the flag of the node mistakenly indicates that the translation is up-to-date and complete.
Remaining tasks
Discuss, decide if this needs a setting.
User interface changes
Comment | File | Size | Author |
---|---|---|---|
#15 | interdiff-2954921-13-15.txt | 611 bytes | johnchque |
#15 | expand_all_when_translatin-2954921-15.patch | 6.91 KB | johnchque |
| |||
#13 | expand_all_when_translatin-2954921-13.patch | 6.16 KB | johnchque |
#9 | interdiff-2954921-7-9.txt | 6.01 KB | johnchque |
#9 | expand_all_when_translatin-2954921-9.patch | 7.1 KB | johnchque |
|
Comments
Comment #2
johnchqueWorking on this.
Comment #3
johnchqueThis might break some tests, up for having a setting for this.
Comment #5
johnchqueSo we just open all Paragraphs when first adding the transation right? Will we then allow the users to close before saving?
Comment #6
miro_dietikerSure, collapse button should work as expected. It's just an expanded default state.
Still not sure how we change setting labels or need extra setting for this. But happy to see it implemented for UI testing.
Comment #7
johnchqueOk, it seems that this should work. Also fixing some tests. Let's see how it goes.
Comment #8
miro_dietikerThe added code condition reads as non-obvious and thus definitively needs a comment.
Beside fixing tests, we should explicitly comment the expectation there.
And from quickly looking at that test above i wouldn't be able to tell if collapse now still works or not while adding a translation.
Let's add asserts and comments that are clear about this change.
Comment #9
johnchqueAdding better tests and a better comment.
Comment #10
miro_dietikerAs discussed, investigating this further leads me to multiple UX questions.
Adding a translation is a special case when you know that such a translator should work through all translatable elements, thus expand makes sense.
If they though don't complete and save, or someone wants to review, they're in the same situation and would want to expand all recursively. If you have multiple containers, even if you have "expand all", you still need to click such an "expand all" button multiple times. And always expanding on a translation page is a bad thing.
Maybe we could define that unpublished translations should always expand all nested children for full review.
But it's clear that we have multiple situations and the need for the default edit state (open / closed) might vary (for paragraph add / edit, translation add / edit).
An alternative perspective was that we maybe need an extra "Expand all recursively" action so this is only a single click and we avoid special case logic.
Needs discussion and definition before we can continue with implementation.
Comment #11
miro_dietikerPostponing this on the other issue to collapse things that can't be translated
#3008687: Close paragraphs without translatable fields while translating
Comment #12
miro_dietikerUnpostponing as the other issue was committed. Needs work as it should be rebuilt on top.
Comment #13
johnchqueTests updated and mostly rewritten. This should work fine, testing locally seems to work nice. :)
Comment #15
johnchqueOops, forgot to remove this. :)
Comment #17
miro_dietikerVery nice work, the translation experience is already so much better!
Let's just start with this and figure out in follow-ups if we need to refine this.
Comment #19
MichelleIs this working for people? It isn't working on a client site and I'm wondering if it's just them or if it's not working in general? This is a big issue because Drupal doesn't translate text fields that are inside of closed paragraphs. So the client is having to manually open them all before saving as a work-around.
Comment #20
Berdir@Michelle: Are you using the experimental widget? All the new features are only there. Which we are using in production and it is "stable", it is simply likely that we'll continue to add more features to and might refactor things between versions.
Comment #21
Michelle@Berdir: That was it! Thank you very much for the fast response. :)