GNOME Bugzilla – Bug 703983
Diff page should not consider lines beginning with «#:»
Last modified: 2018-05-22 12:16:58 UTC
When using the diff page to review a translation, differences between lines beginning with «#:» should not been shown, as they are the line in the source code in which the string appears, but it's not (usually) necessary to know it, and it would simplify the review For example, this kind of differences could be hidden in the diff: #: ../src/easytag.c:3164 #: ../src/easytag.c:3161 Thanks!
Created attachment 299529 [details] [review] Patch to avoid diffs between lines with #: Here is a patch for this bug. Could you please consider reviewing and applying it? Thanks!
Daniel, do you have a live example currently on l10n.gnome.org where I could see the problem and the effect of your patch?
Yes, here you can see there are several differences in lines beginning by #:, https://l10n.gnome.org/vertimus/diff/239995/0/1/ These differences do not affect the proofread nor the revision, but really bother the user when proofreading a translation. Thanks!
Review of attachment 299529 [details] [review]: ::: stats/utils.py @@ +392,3 @@ status = STATUS_OK+1 else: + command = ("msgconv -t UTF-8 \"%s\" | diff -i -I '^#~' -I '^#:' -u \"%s\" - >/dev/null") % ( As -I accepts a regular expression, shouldn't we change '^#~' to '^#[~:]' instead of providing two -I expressions?
It's ok for me :)
Created attachment 299534 [details] [review] Patch updated Here is the patch updated with your suggestion
In fact, the vertimus diff view has nothing to do with this part of the code, unfortunately. The diff view is constructed here: https://git.gnome.org/browse/damned-lies/tree/vertimus/views.py#n212 (using https://docs.python.org/2/library/difflib.html).
That is the only file I see with the pattern '#~' (which is not shown in the diff view)... that's why I thought that was the correct file. How/where could we include this pattern?
Unfortunately, the Python difflib doesn't seem to provide a way to ignore parts of the diff. Initially, the problem stems from the fact that we don't always remerge all files with the current pot file, but only when some string change. It would be much too heavy for the server to regenerate them at each commit, with no significant gains. One possibility would be to offer a "Resync" button to manually force merging of compared files with the latest pot.
Ok, don't worry. It just was an enhancement suggested to avoid showing useless differences, but if it's not possible in a simple way, it's not a critical bug, so we can forget about it. Thanks for taking care of this!
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/damned-lies/issues/50.