[pology] Bug when handling exact matches from compendium

Karl Ove Hufthammer karl at huftis.org
Thu Jul 12 06:38:25 PDT 2018


Dear Pology list members,

I think I’ve found a bug in the fuzzying of exact matches from a 
compendium when merging using Pology. When a *new* message (which only 
exists in the template file, not the translation file) is merged, it’s 
marked as an exact match if it exists in the compendium *even* when 
‘S.compendium_fuzzy_exact’ is set to ‘True’. Here’s a simple example:

Template file:

-----
msgid "foo"
msgstr ""

msgid "This is an old and long message which is easily matched."
msgstr ""

msgid "This is a new and long message which is easily matched."
msgstr ""
-----

Compendium file:

-----
msgid "This is a new and long message which is easily matched."
msgstr "Dette er ein ny og lang melding som ein lett får treff på."
-----

Config file:

-----
S.compendium_fuzzy_exact = True
-----

Translation file:

-----
msgid "foo"
msgstr "føø"

msgid "This is an old and long message which is easily matched."
msgstr "Dette er ein gammal og long melding som ein lett får treff på."

msgid "This is a new and long message which is easily matched."
msgstr ""
-----

Now, when the translation file contains the string but doesn’t contain a 
translation (i.e. the above case), the translation from the compendium 
is used, and *correctly* marked as fuzzy.

But if the translation file *doesn’t* contain this last string (i.e. it 
has been recently added to the POT file, but happens to be identical to 
a string already in the compendium), the translation from the compendium 
is used but it’s *not* marked as fuzzy. In other words, it’s treated as 
an *exact* match.

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

   posummit --force summit-config-shared nn merge

from the ‘merge-example’ folder to test it. Note that the new string is 
added as an exact match, even though ‘S.compendium_fuzzy_exact = True’.

-- 
Karl Ove Hufthammer

-------------- next part --------------
A non-text attachment was scrubbed...
Name: merge-example.tar.gz
Type: application/gzip
Size: 1256 bytes
Desc: not available
URL: <http://lists.nedohodnik.net/pipermail/pology-nedohodnik.net/attachments/20180712/3c7a0bf4/attachment.bin>


More information about the pology mailing list