Revert translations done by a specific user on a specific day

Asked by Taylor Smock

Hello, I work on JOSM, and the user who added most of a translation to Launchpad is telling us that (a) it wasn't him and (b) the translations are wrong. The poor translations from him were done over a single day. Is there a way for us to revert those translations? (Note: This was done in 2015).

Our ticket, for those who want to read it: https://josm.openstreetmap.de/ticket/21720

The user (mxn) has told us that on 2015-05-12, someone/something uploaded around 7800 strings using his account.
Filter: https://translations.launchpad.net/josm/trunk/+pots/josm/vi/+filter?person=mxn

We would like to do the following:
1. Reset/revert strings changed by mxn on 2015-05-12 for the Vietnamese translation.

What I have tried:
1. Writing a script to reset the translations (or set them to "")
Partial script for (1) in `What I have tried` (partial since it only gets the VI translation):
```
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from typing import Optional
from launchpadlib.launchpad import Launchpad, ProjectSet
from launchpadlib.credentials import Consumer
from lazr.restfulclient.resource import Entry

def main():
    cachedir = './cache'

    launchpad: Launchpad = Launchpad.login_with(
        'josm ticket #21720: reset vi translation', 'production',
        cachedir, version='devel')
    josm: Entry = launchpad.projects("JOSM")
    trunk: Entry = josm.series[0]
    template: Entry = trunk.getTranslationTemplates()[0]
    translation: Optional[Entry] = None
    for tTrans in template.translation_files:
        if "josm/vi" in tTrans.self_link:
            translation = tTrans
            break
    if not translation:
        raise NotImplementedError("Don't currently know what to do if translation isn't found")
    # At this point, nothing else can be done -- there are no further API calls to make

if __name__ == "__main__":
    main()
```

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
Ioana Lasc Edit question
Solved by:
Ioana Lasc
Solved:
Last query:
Last reply:
Revision history for this message
Guruprasad (lgp171188) said :
#1

Hey there, we are looking into this and will post an update once we have made some progress.

Revision history for this message
Ioana Lasc (ilasc) said :
#2

Hi

Just a quick update to say this needs development work on our side, we have a merge proposal in progress to add a date filter to our remove translations scripts, we will update you here as soon as that lands and it's usable.

Thank you for your patience.

Revision history for this message
Taylor Smock (tsmock) said :
#3

Thank you for your update.

Revision history for this message
Launchpad Janitor (janitor) said :
#4

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Guruprasad (lgp171188) said :
#5

Re-opening it because the question/issue is not resolved.

Revision history for this message
Guruprasad (lgp171188) said :
#6

Assigned this question to Ioana Lasc, who is working on a solution, to prevent the janitor from expiring this question again.

Revision history for this message
Ioana Lasc (ilasc) said :
#7

Another quick update here, this is still being worked on.
New code is now in Production, filled internal RT 151420 to perform a dry run.
Will update here when the actual deletion in Production occurs and translations from this user on that particular date should no longer be visible.

Revision history for this message
Taylor Smock (tsmock) said :
#8

Thank you for the update.

Revision history for this message
Best Ioana Lasc (ilasc) said :
#9

Hi Taylor

The strings changed by mxn on 2015-05-12 for the Vietnamese translation have now been deleted in Production.

Revision history for this message
Taylor Smock (tsmock) said :
#10

Thanks Ioana Lasc, that solved my question.