Skip to content

Showing text diff and old translation (tagged as needs revision) for changes made in synchronized translation #502

Description

@jnagler-git

The current behaviour: when changing a field e.g., a paragraph, in the default language the old translation of that field gets deleted after the synchronization and the new text does not show any hints of changes that have been made. Thus, a new translation is needed.

It would be nice to have a diff feature, that does not delete the old translation, but to show it with a text diff of the default language. Sometimes just a few words or single sentences change in paragraph, so the translator can save a lot of time with this feature.

To not just give a request, I was looking a bit around and found out that this might be done using Google's diff_match_patch library in the following way:

import diff_match_patch
dmp = diff_match_patch.diff_match_patch()
diffs = dmp.diff_main('This is my original paragraph.', 'This is my revised paragraph with new words.')
 # semantic cleanup seems important 
dmp.diff_cleanupSemantic(diffs)
print(diffs)  

Output: [(0, 'This is my '), (-1, 'original'), (1, 'revised'), (0, ' paragraph'), (1, ' with new words'), (0, '.')]

This could then be canonically written as "This is my original revised paragraph with new words." Having the old translation still available then makes it a lot easier to revise the changes instead of translating it from scratch.

Would be wonderful to have this feature considered for wagtail-localize.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions