Problem/Motivation
It would be helpful when you're on the translation overview to return to the overview after adding or editing the translation. This matches what we do for content listings.
Proposed resolution
Add ?destination= query parameters to all the operations on the Content Translation overview.
Remaining tasks
Address #11
User interface changes
After adding or editing a translation the user is brought back to the translation overview page instead of the default redirect provided by the entity type (usually the view page).
| Comment | File | Size | Author |
|---|---|---|---|
| #39 | translation_overview.jpg | 140.65 KB | rkoller |
| #31 | 3025384-31.patch | 12.47 KB | ranjith_kumar_k_u |
| #27 | interdiff_26-27.txt | 1.53 KB | suresh prabhu parkala |
| #27 | 3025384-27.patch | 12.5 KB | suresh prabhu parkala |
| #26 | 3025384-26.patch | 12.49 KB | karishmaamin |
Comments
Comment #2
tstoecklerHere's a patch that implements this. Let's see what breaks.
One thing that is interesting is that by using the
RedirectDestinationservice is that when reaching the translation overview (e.g./node/1/translations) from the content listing (e.g./admin/content), the destination is actually kept as/admin/contentso that you return to the content listing and not the translation overview after adding/editing a translation. I actually think that's a neat touch, though, not sure what others think.Comment #4
tstoecklerSorry, didn't have #2691675: Replace deprecated entityManager() in ControllerBase descendents locally yet.
Comment #6
tstoecklerThis should be green.
Notes on the interdiff:
ContentTranslationUITestBaseshow that no additional test coverage is needed.Comment #7
kristen polThanks for the patch. I did a review for clarity and formatting and didn't see anything wrong except one comment could be added to the original code (see below). I'll do some testing.
Nitpick: I know this is from the original code, but it would be good to add comment to make it clear why only French is tested here since Italian is tested for the other tests.
Comment #8
kristen polI have tested as follows:
Comment #9
kristen polGiven this is working and the code seems fine (except minor nitpick with original code in comment #7 which could be addressed), I'm going to mark this RTBC.
Comment #10
tstoecklerThanks for the review @Kristen Pol!
Re #7: To be honest, I don't really know why that part of the test is only for French, so I don't think I could add a meaningful comment.
By the way, while the primary purpose of this is improved usability, this is also useful for people that have a custom entity type and, like me, are sometimes too lazy to write dedicated form classes, so that there is no redirect (and no status message) after submitting an entity form. In that case, currently you get an "Access denied" page after adding a translation because you stay on e.g.
node/1/translations/add/de/enbut that translation has already (just) been created. With this patch you can properly translate entities without having to provide a proper form class.Comment #11
alexpottI've tested this manually and I think this makes a lot of sense. But I have one concern. At the moment when you add a new translation to an existing node you can taken to the view the translation once you are finished. This patch changes that behaviour - either taking you to admin/content or node/NID/translate depending on how you started. That's quite a big change that I'm not sure is correct because adding is very different from editing something that exists already. I think that this needs discussion.
Comment #12
kristen polAh, good catch, @alexpott. I was only testing from the translate page. I've tested from the admin/content page and added some screenshots to show the issue. I think that UX is ok myself since it gets you back to where you started but I can see why someone might argue to redirect to the translation overview if you did a translation. For the latter, the destination should get altered on the links on the translate page to swap out the admin/content path?
Comment #16
kristen polPatch from #6 applies cleanly to 9.1.x. Kicking off tests.
Comment #18
hudriApplied patch #6 successfully on v9.1.3, but it no longer applies on v9.1.4
Comment #20
kristen polPer #18, needs reroll.
Comment #21
neslee canil pintoApplied reroll, but when trying to do interdiff i was getting the following error
does anyone know why this is happening.
Comment #22
artemboikoPatch for 9.2.x
Comment #23
artemboikoA small typo in the previous patch (3025384-21_0.patch)
// Add a French translation (revision 3).;Comment #25
yogeshmpawarNeeds re-roll against 9.3.x branch so moving to Needs work.
Comment #26
karishmaamin commentedRe-rolled patch against 9.3.x. Please review
Comment #27
suresh prabhu parkala commentedTried to fix custom failures.
Comment #29
kristen polTagging for testing.
Comment #30
kristen polBringing up #11 from @alexpott again as no one besides myself has chimed in on that. All the other comments after that were for version changes and re-rolls.
No need for manual testing until we decide that this new behavior is what we want.
Comment #31
ranjith_kumar_k_u commentedRe-rolled #27 for 9.4
Comment #34
jedihe commented#31 works for me; manually tested on Drupal 9.4.8, with 2 languages enabled; tested both explicit and implicit destination.
Comment #35
smustgrave commentedTagging for usability review for the issue brought up in #11
Comment #37
smustgrave commentedAs I learn more realized this should move to NW for best approach for #11. Then when a decision is made should it be sent to usability.
Decision should be documented in issue summary with reason why.
Comment #38
rkollerUsability review
We've discussed this issue at #3358491: Drupal Usability Meeting 2023-05-12. The recording of the meeting can be found under the following link: https://youtu.be/Z22Hbe3yQtg?t=552
For the record, the attendees at the usability meeting were @aaronmchale, @benjifisher, @rkoller, and @shaal.
At first apologies that it took a while. :( The issue was on the meetings shortlist for a few weeks now, but we only got around to discussing it about three weeks ago. During the write-up I’ve stumbled across a few more details as well as an issue with multilingual in Drupal 10.1.x-dev that delayed things further plus the last one or two weeks were a plain nightmare making me unable to finish the write-up. Sorry again.
During the meeting we've compared the current with the patched state in the different contexts and tasks at hand on Drupal 10.1.x-dev with three languages, English, German, and French, installed. On the
Detection and selection-page,Account administration pagesis checked and on the user profile pagesite languageandadministration pages languageis set toEnglishand the translations for the content typeArticleis activated. In the first table, I have listed the destination parameters of each context and it’s tasks.admin/contentTask: Adding a translationadmin/contentTask: Adding a translation/admin/content->/node/1/translations?destination=/admin/content->/node/1/translations/add/en/de?language_content_entity=de->/node/1?language_content_entity=de/admin/content->/node/1/translations?destination=/admin/content->/node/1/translations/add/en/de?destination=/admin/content&language_content_entity=de->/admin/contentadmin/contentTask: Editing a node/translationadmin/contentTask: Editing a node/translationadmin/content/admin/content->/de/node/1/edit?destination=/admin/content->/admin/contentadmin/content/admin/content->/de/node/1/edit?destination=/admin/content->/admin/content/admin/content->/node/1/translations?destination=/de/admin/content->/node/1/edit?language_content_entity=de->/node/1?language_content_entity=deadmin/content(3 clicks)/admin/content->/node/1/translations?destination=/admin/content->/node/1/edit?destination=/admin/content&language_content_entity=de->/admin/contentViewtab on node page Task: Adding a translationViewtab on node page Task: Adding a translationTranslate-tab/node/2->/node/2/translations->/node/2/translations/add/en/de?language_content_entity=de->/node/2?language_content_entity=deTranslate-tab/node/2->/node/2/translations->/node/2/translations/add/en/de?destination=/node/2/translations&language_content_entity=de->/node/2/translationsViewtab on node page Task: Edit German translationViewtab on node page Task: Edit German translationEdittab/node/2?language_content_entity=de->/node/2/edit?language_content_entity=de->/node/2?language_content_entity=deEdittab/node/2?language_content_entity=de->/node/2/edit?language_content_entity=de->/node/2?language_content_entity=deTranslatetab/node/2?language_content_entity=de->/node/2/translations?language_content_entity=de->/node/2/edit?language_content_entity=de->/node/2?language_content_entity=deTranslatetab/node/2?language_content_entity=de->/node/2/translations?language_content_entity=de->/node/2/edit?destination=/node/2/translations%3Flanguage_content_entity%3Dde&language_content_entity=de->/node/2/translations?language_content_entity=deIn the second table the destinations for the different contexts are listed. That way it was easier to compare the behavior.
<code>admin/contentView-tab on node pageadmin/content<code>admin/contentadmin/contentadmin/contentView-tab on node pageadmin/contentView-tab on node pageTranslatetabView-tab on node pageEdittabView-tab on node pageView-tab on node pageTranslatetabView-tab on node pageWithout the patch applied on save, in every context and for every task, the user is getting redirected to the
View-tab page of a node, except in example C2 where the user is getting redirect back toadmin/content. That way the destination was sort of consistent and predictable but the downside was that the user's flow was interrupted by getting redirected to the node’s page most of the time.With the patch applied the behavior gets a bit more diverse and potentially confusing across the different contexts and tasks (C1-C6). The user is getting redirected back to
admin/content</code in the context of <code>admin/contentwhere you’ve started off (C1-C3) while getting redirected in most cases “half way” to the translation overview page (C4&C6) instead of the nodesview-tab page (C5) in the context of nodes, as pointed out in #11.In general it is nearly close to impossible based on the potential different scenarios ("are you building out a site and its content" or "are you just governing already existing content"), contexts (
admin/contentor thenode page), and the tasks at hand (add a node,add a translation after saving a node,editing a node,editing a translation after saving a nodeand so on) to manage everything with a singleSavebutton and at the same time challenging for the user to remember all the different destinations based on the current context and task at hand.There was an agreement it would be clearer to add a secondary save button, a pattern that is utilized on the
Add term-page. There you have aSaveand aSave and go to list-button. In the context of the current patch it would make sense adopting the aforementioned pattern for C1, C3, C4 and C6. With save the user would be redirect to the node’s view page while with the other button the user could be directed back to the translation overview page.In regards of the button label one worry the group had was coming up with a brief and concise label with two to three words tops.
Save and go to listis already too long for example. One idea that came up wasSave and translatewhich would concise enough but is way too ambiguous.So the suggestion, not a clear recommendation, for the next steps would be adding a secondary button to C1, C3, C4 and C6 with the following labels:
Save (this translation)(no destination parameter - the user gets redirected, depending on the context, toadmin/contentor theView-tab of the corresponding node)Save and go to list(use the translation overview page as the destination parameter - user gets redirected to the translation overview page of the current node)Then opening a follow-up issue about shortening and clarifying the button label.
Save and go to listis too long and “list” might also be confused with the list of content onadmin/content.The other option for a follow-up issue might be to extend the adoption of the secondary button pattern to C2 and C5 but using another destination parameter there. But all that would be out of the scope for this issue.
Comment #39
rkollerDuring the write-up for #38, when i was testing and also collecting feedback in a meetup, I ran into two more details to take into consideration:
1. @rocketeerbkw noted during the Drupal Dojo Austin that the current patch doesn’t preserve the filter settings you were using on
admin/content. If filter for example forBasic pageand then edit or add a translation the destination you are getting redirected to in the end is again/admin/contentinstead of/admin/content?title=&type=page&status=All&langcode=All. it would be reasonable that the user is returned to the page and filter setting that one left off.2. In the context of the translation overview page for individual nodes having the translation overview as the destination causes another problem. It is sort of difficult to grasp the language context you are in on the translation overview page. In the environment i had set up i have three languages (english, german, french) installed and the administration language is set to english.
in the current screenshot the admin language changed to german even though the admin language is set to english. i was editing the german node. when being redirected to the translation overview page the status message says that the german article was updated, the h1 says these are the translations for the french article, while in the language list you have english bolded as the original language. if you have a short working memory, or you get distracted or are away from your computer for a while and return you will have to at least think for a moment in which context you actually are and which version you will get to when you hit the edit tab (bearbeiten). It is sort of difficult due to #2313309: Admin toolbar, Navigation and contextual links should always be rendered in the admin language (if set) and #2864972: Content and interface translation don't clearly separate to reproduce the setting i illustrate in the screenshot consistently. But nevertheless the edit button is sort of problematic with the translation overview page as the destination. Definitely out of the scope of this issue but i think it would be reasonable to have at least a discussion.