Opened 6 years ago

Last modified 3 years ago

#186 new enhancement

Delete translation set

Reported by: abdessamad idrissi Owned by: somebody
Milestone: 1.0 Priority: major
Version: Component: General
Keywords: has-patch 2nd-opinion Cc: willmot


It would be a good idea to allow admins to delete a complete translation set.

Attachments (1)

186.diff (4.2 KB) - added by willmot 5 years ago.

Download all attachments as: .zip

Change History (13)

#1 @vanillalounge
6 years ago

'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.

#2 @abdessamad idrissi
6 years 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.

#3 @defries
5 years ago

  • Milestone set to 1.0

#4 @willmot
5 years ago

  • 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.

5 years ago

#5 @tcrsavage
5 years ago

Tested this on translate.happytables.com

Seems to work nicely

#6 follow-up: @vanillalounge
5 years ago

it doesn't delete the associated translated strings from gp_translations.

Should it? Needs feedback.

#7 in reply to: ↑ 6 @willmot
5 years ago

  • 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.

#8 @willmot
5 years ago

Anything I can do to get this patch committed? It's been running on both of our GlotPress installs for a while.

#9 @markoheijnen
5 years 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.

#10 @vanillalounge
5 years 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.

This ticket was mentioned in Slack in #glotpress by markoheijnen. View the logs.

3 years ago

#12 @saas
3 years ago

Any recent updates on this ticket?

Note: See TracTickets for help on using tickets.