[pology] Pology bug where non-exact compendium matches lose information on previous strings

Karl Ove Hufthammer karl at huftis.org
Sat Feb 27 03:16:16 PST 2021


Dear Pology list members / Chusslove,

I’ve found a bug in the way fuzzying of non-exact matches from a 
compendium works when using Pology. In some cases, the ‘previous 
message’ msgid gets lost. It’s easier to explain with an example:

A template (.pot) and a translation (.po) files both look like this:

   msgid "Show closed files"
   msgstr ""

   msgid "Show all closed files"
   msgstr ""

The compendium looks like this:

   msgid "Show closed files"
   msgstr "Vis lukka filer"

So the compendium has an exact match for the first string and a close 
match for the second one.

When I do a merge using the compendium, the .po file correctly turns into:

   #, fuzzy
   msgid "Show closed files"
   msgstr "Vis lukka filer"

   #, fuzzy
   #| msgid "Show closed files"
   msgid "Show all closed files"
   msgstr "Vis lukka filer"

I can now easily see that for the first message, the msgid for the 
string that was used to fill in the fuzzy translation was an exact 
match, so there’s a good chance that the suggested translation is OK. 
But for the second string, the msgid used to fill in the translation 
differed from the msgid of the present string, so the suggested 
translation might need some editing. This is useful information.

But when I do a *second* merge, the file turns into:

#, fuzzy
msgid "Show closed files"
msgstr "Vis lukka filer"

#, fuzzy
msgid "Show all closed files"
msgstr "Vis lukka filer"

That is, the ‘previous message’ information for the second string is 
lost. This makes it look like an exact match, which makes it easy to 
miss small changes in the msgid. So that’s the Pology bug.

Note that if the first message don’t exist in the template file, this 
bug doesn’t happen. In this case, the ‘previous message’ is kept, no 
matter how many times you do the merge.

I’ll attach an archive with a set of example files. Just extract it and run

   posummit --force summit-config-shared nn merge

(twice) from the ‘previous-string-merge-bug’ folder to test it.


-- 
Karl Ove Hufthammer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: previous-string-merge-bug.tar.gz
Type: application/gzip
Size: 1695 bytes
Desc: not available
URL: <http://lists.nedohodnik.net/pipermail/pology-nedohodnik.net/attachments/20210227/d352ced5/attachment.bin>


More information about the pology mailing list