Opened 15 months ago
Last modified 3 weeks ago
#186 new enhancement
Delete translation set
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | major | Milestone: | 1.0 |
| Component: | general | Version: | |
| Keywords: | has-patch 2nd-opinion | Cc: | willmot |
Description
It would be a good idea to allow admins to delete a complete translation set.
Attachments (1)
Change History (11)
comment:1
vanillalounge — 15 months ago
Yes that's what I mean; deleting created translations sets - the same as super admins being able to delete projects.
To experiment, I created a test translation set and now I want to delete it and let only the real project translations... But there's no function to do that yet.
- Cc willmot added
- Keywords has-patch needs-testing added
Had a bash at this, we're running the attached patch on translate.hmn.md.
It adds a (delete) link after (edit) when viewing a single translation set.
Currently it just deletes the translation set from the gp_translation_sets table, it doesn't delete the associated translated strings from gp_translations.
comment:6
follow-up:
↓ 7
vanillalounge — 7 months ago
it doesn't delete the associated translated strings from gp_translations.
Should it? Needs feedback.
- Keywords 2nd-opinion added; needs-testing removed
Replying to vanillalounge:
it doesn't delete the associated translated strings from gp_translations.
Should it? Needs feedback.
The reason I didn't bother deleting the actual strings is that's also the behaviour of the other delete functions (delete project for example).
If it's decided that deleting a project / translation set should also delete all strings as well then I'd be happy to add the patch.
Anything I can do to get this patch committed? It's been running on both of our GlotPress installs for a while.
comment:9
markoheijnen — 2 months ago
I will test the logic when I have time. It seems like there is a capability check missing in delete_get() but I don't know the code on that place so I can be wrong. Having unit tests to test the delete_get() logic would help.
comment:10
vanillalounge — 3 weeks ago
I've played around a bit with this patch. Some notes:
- Project in gp_projects gets deleted.
- Everything in gp_translation_sets and gp_translations remains.
Which makes me wonder if it's the right approach, or why doesn't everything get deleted. Since entries in gp_translation_sets are associated with a project_id (gone after project delete) and entries in gp_translation are associated with a translation_set_id, it looks like we're left with a bunch of "floating", unattached entries in both tables.
Assuming the above approach is sound, I suggest to expand the patch to delete those, too.

'Translation set' in GP-speak, means the whole language, translated or not. Being able to delete this might not be a good idea for admins (in the sense of validators), although it does make sense for superadmins.