Follow-up to #2476563: Entity operations links tied to original entity language, ignore everything else
Problem/Motivation
Currently, deleting a source translation means everything disappears, and we behave differently in the UI depending on whether we are dealing with a source translation or not. This means we have to do workarounds such as changing deletion links for an entity if we're dealing with a source translation, which ideally we wouldn't have to do.
Quoting from @Gabor in #2476563: Entity operations links tied to original entity language, ignore everything else
When you delete the original translation of an entity, the entity API should have provisions already to pick another original language for that entity I believe.
Apparently these provisions do not exist yet.
@plach
In this case ideally we should remove only the original translation and designate a new default entity language, but this may not be trivial to achieve
Proposed resolution
Allow for the original language to be reassigned in the entity API
Remaining tasks
- Figure out what we will do whenever a user removes a source translation
- Validate the proposed solution
- Write a patch
- Reviews
User interface changes
TBD
API changes
TBD
Comments
Comment #1
stefan.r CreditAttribution: stefan.r commentedThe UI implications of this are probably out of scope for this issue, but at least thinking of what we're going to do on the UI level may help us think of a proper solution for this. I had discussed this earlier with some people and some of the solutions mentioned for how to deal with a source translation deletion were:
If the node only has 2 languages:
- just assign the other language.
If the node has 3 or more languages:
- ask the user in a confirmation screen what the new original language for every entity will be.
- or: have a ready made weighted list of default languages, where we just go to the next in line.
Or maybe we could just say none of the translations is a source translation anymore? And I say that not knowing why we need one of the translations to be marked as a source translation in the first place and how much logic depends on this... On an intuitive level it makes sense though, if we delete a piece of content that's the source of all other translations and we ask the entity which of the existing pieces of content is the source, the answer is actually "none of them".
Comment #2
stefan.r CreditAttribution: stefan.r commentedComment #3
plachI think we should try to solve #2443991: Allow default_langcode field value to be changed first.
Comment #9
AnybodyI just ran into the same problem. This is a follow-up to #2486177: Deleting an entity translation from the UI deletes the whole entity I think.
We'd like to remove the source language because a user created contents in the wrong language initially which have already been translated into several languages. Now the source language should be removed. So what I think we'd need is a delete functionality for the source language on the translations tab.
Currently you can only delete translations or the whole content. This applies to all types of translatable entities (node, taxonomy term, ...)
Comment #11
acontia CreditAttribution: acontia commentedWhat's the current status of this? Did anyone manage to get this working?
Comment #12
geek-merlinThere is some pasted code over in #2443991-19: Allow default_langcode field value to be changed. Maybe we unite the tickets.