pyg3t / poproofread

GNU General Public License v3.0
0 stars 0 forks source link

Fejl ved inline kommentering #7

Closed KennethNielsen closed 8 years ago

KennethNielsen commented 9 years ago

Jeg har prøvet kommentering af en po-fil.

Når inline-kommentering slås til, vil man kun se den tidligere ikke-inline-kommentar hvis der er en.

Når inline-kommentering slås fra, vil alt hvad der står i hovedtekstfeltet blive kopieret til også at stå i kommentarfeltet nederst. Dette gælder endda også hvis intet er ændret.


Imported from Launchpad using lp2gh.

KennethNielsen commented 9 years ago

(by k-nielsen81) Hallo Byrial (I'll continue in english as I hope this program will eventually be used outside of Dansk-gruppen as well, so I think it is better if the bug reports are in english)

Thanks a lot for your bugreport. I'll group two of your issues together, as they pertain to the same behavior, namely what gets copied or removed when (de)activating in-inline commenting.

  1. When activating in-line commenting and there is already a comment in the comment field, only this comment will remain and the diff chunk will not be copied to the comment field
  2. When decativating in-line commenting, the comment field will keep all of the text that was there before, even if that text was all the diff chunk and nothing had been changed.

The reason for 1 is that I was worried of the comment growing, if the diff chunk was simply added to the comment everytime in-line commenting was activated, because I don't remove anything when we de-activate in-line commenting. This behavior was actually the one I original intended and then the idea was to add a function that you could use when you activate in-line mode, with an existing comment, that would copy the diff chunk to the place of the cursor and when deactivating in-line mode you would manually have to delete the diffchunk (This really shouldn't happen this often that you change your mind about whether to do in-line commeting or not). But since seeing your bugreport, I have thought a little about it and I think I have come up with a better way to make it work.

So the idea is to change it so that when activating in-line mode the diff chunk will always be copied to the beginning of the comment, so that if an existing comment is there, the diff chunk will simply be prefixed to it. And then when deactivating in-line mode, I'll see if the entire diff-chunk exists in an unbroken state in the comment, and if it does I'll remove the diff chunk part from the comment. I think that should take care of both points, what do you think?

The last thing that you mention is that when you deactivate in-line commenting mode the entire content of the "main" window will be copied to the comment window (even if nothing was changed). I think the last part has to do with what we discussed above, namely about removing the diff chunk from the comment when deac inline. But there is also a misunderstanding here about how the program works. There is no "main" windown. In ordinary mode, the top window is the diff window and the bottom window is the comment window. What happens when you activate in-line commenting mode is that the comment window is expanded to take up the entire space and the diff chunk is then copied to the comment window because we need it. This makes the comment window "look like" the diff window did before, but it is in fact still the comment window. So the content of the one window in inline mode is actually not copied to the comment window when you deac inline, it is simply kept, because it is the comment window.

The question is whether there is a real problem here in this misunderstanding, after we fix the other stuff above. Will this add some confusion to the usage. One way to possibly fix it is to add a headline to both of the fields so that you can always see which is what, on the other hand that also takes of screen space, so I would rather not do that unless it is necessary. What do you think?

Regards Kenneth (TLE)

KennethNielsen commented 9 years ago

(by byrial-t) Hi

It will be fine to remove the diff chunk from the comment if you can when inline mode is deactivated.

However there may be a problem if the diff chunk still remains in the comment but is changed somehow so it cannot be recognized. In that case you could warn the user that the comment may more or less duplicate the diff chunk.

It might be better only to copy msgstr part from the po file to the comment in the first place. It will make less bloat to the comment, and that is normally the only part you wish to make comments for.

KennethNielsen commented 9 years ago

(by k-nielsen81) Hallo

About the first part, the idea is to only remove the diff chunk if the entire diff chunk is present without any comments in it. I think that is the way we want to do it. How aggressively we should try and remove the diff is a compromise between making sure that the user does not loose any work and saving the user the trouble of sometimes deleting a little extra text himself. In that case I think it is better to stay on the safe side of making sure that the user does not loose work.

About the second part. The other parts of the diff chunk contains information that the original translator may need, e.g:

  1. Which line in the file the po-message originates from (needed for quickly finding the message)
  2. Translator or programmer comments that may have guided the translation and the proofreader may have missed, therefore they should still be there when the proofreading is delivered, so that the translator will not have to look in the original file, but can spot the error simply from the email correspondance.
  3. The comment sometimes also pertain to the literal translation, i.e. how the wording in the msgid has been transformed into the msgstr.

So In general I think it is better to keep all of the information. Besides by using PoProofRead we automatically only outputs the diff chunks that were comments for, so we are already limiting the proofreading text a lot.

Regards Kenneth

KennethNielsen commented 9 years ago

(by k-nielsen81) Fixed in revision 77.

PoProofRead will now: When activating in-line mode always copy the diff part to the start of the comment and put a blank line between the diff part and the comment (or the cursor of the comment was empty). When de-activating in-line mode it will always remove the diff part from the comment (in any number of copies), provided that it is complete, and afterwards strip blank newlines from the beginning of the comment.

Regards Kenneth

KennethNielsen commented 8 years ago

Already fixed.