mondeja / mdpo

Markdown files translation using GNU PO files
https://mondeja.github.io/mdpo/
BSD 3-Clause "New" or "Revised" License
25 stars 5 forks source link

md2po remove-not-found argument doesn't seem to work #202

Closed keunes closed 2 years ago

keunes commented 2 years ago

Given

the argument to remove not-used messages doesn't seem to have any effect: when I change a text in an MD file, then execute the above code, the message containing the old text is commented out (marked obsolete), but still in the PO file.

mondeja commented 2 years ago

A patch for this error has been included in v0.3.80. Cheers!

keunes commented 2 years ago

Nice! Thanks!

keunes commented 2 years ago

Hi @mondeja I just updated mdpo and have now v0.3.80. It seems to have improved, but not all unused messages are removed: only the last one in the PO file is now removed, so I need to run md2po multiple times in order to remove all obsolete messages from the PO output.

keunes commented 2 years ago

Hmmm, weird. After deleting the PO file and let md2po create it from scratch, all unused strings are now removed properly after edits.

mondeja commented 2 years ago

I can't reproduce it. Could you share a reproducible example?

keunes commented 2 years ago

What do you mean with a 'reproducable example'? My original post already lists the environment and project & files with which I had the original issue. The removing of one obsolete message per time happened like this:

mondeja commented 2 years ago

I've tried it and I can't reproduce it. Could you reproduce it using some other environment? Maybe a repository with only the affected files? Maybe a script? It would be much more easy to debug by this way.

keunes commented 2 years ago

Is it possible to downgrade mdpo? If so I'm happy to test if I can reproduce :)

mondeja commented 2 years ago

What do you mean with "downgrade mdpo"? You can install whatever version you want with pip install mdpo==X.Y.Z

keunes commented 2 years ago

@mondeja Ok, see repo https://github.com/keunes/mdpo-bug-test The PO file contains a few obsolete strings, created by mdpo v 0.3.73.

Running md2po en/*.md --po-filepath PO-files/site-general_en.PO --save --quiet --remove-not-found (with mdpo v0.3.80) deletes the following two (out of the four) obsolete strings:

#~ msgid ""
#~ "You can download official AntennaPod builds on Google Play and on F-Droid."
#~ msgstr ""

#~ msgid ""
#~ "AntennaPod is a podcast player, completely free and respectful of your "
#~ "privacy. It's created by volunteers throughout the world without any "
#~ "commercial interest. Together we contribute to an open podcasting ecosystem."
#~ " So that you get to enjoy the web's best audio content."
#~ msgstr ""

These obsolete strings are still there:

#~ msgid ""
#~ "Press the button above to subscribe to this podcast in AntennaPod. If you "
#~ "don't have AntennaPod installed yet, you can [download the app "
#~ "here](/download)."
#~ msgstr ""

#~ msgid "Website theme"
#~ msgstr ""

Running the same command again removes the Press the button above... string (and Website theme is left). Running the same command a third time removes also Website theme.

mondeja commented 2 years ago

Thank you for the detailed report. It's fixed and released in v0.3.81. Let me know if you experiment any problem 👍🏼