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

Karl Ove Hufthammer karl at huftis.org
Tue Mar 2 12:39:08 PST 2021


Chusslove Illich skreiv 28.02.2021 21:27:
> I attach a patch that fixes it, but could you first try it on your side?
> Maybe run a full merge with and without the patch, and check that
> nothing unexpected happens with the patch applied.


Thank you for the very quick response! I have tested the patch. With it, 
there seems to be some changes in the way plurals are handled. This only 
affected 4 out of 1773 files, and I’m not sure if the new behaviour is 
better or worse. So I think it’s OK.

But when testing, I found a behaviour which I find somewhat confusing, 
but which may be intended. What should happen when a string is matched 
with a similar *fuzzy* string in the same file? Example (PO file):

#, fuzzy
#| msgid "One city matches search criteria"
#| msgid_plural "%1 cities match search criteria"
msgid "Exact matches search"
msgstr "Éin by møtte søkjekriteria"

#, fuzzy
msgid "Interpolated matches search"
msgstr "Foo bar baz."


When merging (with an empty compendium and a POT file containing at 
least the first string), the first string is turned into:

#, fuzzy
msgid "Exact matches search"
msgstr "Foo bar baz."

Note that there is no longer a ‘#|’ comment indicating the msgid of the 
suggestion. So it looks like the original msgid is the present msgid. I 
guess this makes sense, because if a fuzzy string don’t have a ‘#|’, you 
don’t *know* what its original msgid was. It’s perhaps not be the 
present msgid, since the PO file might have been generated without the 
‘--previous’ option for msgmerge.

On the other hand, if you *always* use ‘--previous’ (or the equivalent 
for Pology), the loss of the original ‘msgid’ is a problem, since it now 
looks like ‘Exact matches search’ *was* the original msgid for the 
translation ‘Foo bar baz.’ (since there isn’t a ‘#|’ comment).


-- 
Karl Ove Hufthammer



More information about the pology mailing list