From karl at huftis.org Fri Apr 29 12:52:07 2022 From: karl at huftis.org (Karl Ove Hufthammer) Date: Fri, 29 Apr 2022 21:52:07 +0200 Subject: [pology] Pology bug where non-exact compendium matches lose information on previous strings In-Reply-To: <52b0df49-8c7d-56ae-99d0-36102a7dfe06@huftis.org> References: <0a5b10d6-b561-d0c4-96d8-b3378d350e72@gmx.net> <52b0df49-8c7d-56ae-99d0-36102a7dfe06@huftis.org> Message-ID: <3dc8e92f-f8a5-d0cf-ceeb-aee6846b4f6c@huftis.org> Hi! See the e-mail discussion below. I?ve now been running Pology with this patch for over a year, with no ill effects (except the one mentioned below). Any chance it can be merged? Karl Ove Hufthammer Karl Ove Hufthammer skreiv 02.03.2021 21:39: > 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).