Steps to reproduce
- Install drupal
- Install language and content translation module
- Add a second language
- Mark node articles as translatable
- Create some content, and translate it
- Go to /admin/content and you'll see two rows, one for each :
More detailed description of the problem space
If you make a multilingual site in D8 with a few nodes that are translated, the node/admin page is pretty much broken.
The reason is that Views in multilingual makes each row of the view be a *translation*, not a single node, but the node admin view acts as if it's a list of single nodes, and was always expected to be this:
- The bulk operations and operations links in the rows are for single nodes. For instance, if you selected the French translation of node/1 and clicked Delete either in the row ops or with bulk ops, it would delete all translations, while the UI expectation would definitely be (since you could also see the Spanish and English versions there) that you're deleting just the French one.
- The table is just plain longer than it needs to be by a factor of the number of translations.
As a secondary problem, the exposed language filter UI on that page is also confusing -- what would it mean, even if the view were fixed to be one-line-per-node? Would you be filtering by the original node language, or "this node has a translation in this language"?
a) Fix the admin/node view so that each row is a single node. This will involve either:
- A new filter added to the view that picks out the "original" for each node. This would be the node_field_data.default_langcode field. I don't think there is currently a filter on this Boolean db field, but it would be fairly trivial to add it to the NodeViewsData class if not.
b) Make some sensible choices for how to display the node fields in each output row (title, etc.), depending on the UI language selected for the page. Probably the sensible thing is to make sure the display setting on the view is set to the UI text selected language, so that if you're at fr/admin/node you'd see all nodes displayed with their French titles, and en/admin/node would show you them with their English titles. I believe there's a fallback on this display setting so that if a node didn't have French, you'd see it in its original language, or something like that.
c) Figure out what to do with the exposed Language filter. I think that the only sensible choices would be:
- Make it filter by "this node has a translation in X language"
- Make it filter by the original language of the node
- Don't have this filter
I do not believe that either of these filters currently exist in Views for Nodes, but maybe the second does actually? Not sure. Either way, the UI label/description for this filter would need an update too.
d) Maybe for multilingual we need a second view that shows node translations rather than individual nodes, and allows bulk/row ops appropriate to translations? In this view you could definitely filter by language, and you'd want the view to show each node in the row language. The ops would be something like "edit this translation" and "delete this translation".
Discuss what exactly to do, make a patch
User interface changes
The admin/node page will be usable in Multilingual. Maybe we have an additional view.