Red Hat Bugzilla – Bug 961413
Publican creates blank POT files
Last modified: 2013-08-09 00:49:00 EDT
Description of problem: Publican creates POT files for where there are no strings in which to translate.
Version-Release number of selected component (if applicable): 2.8
Actual results: Publican creates blank POT files when the XML file contains no translatable content.
Expected results: Publican determines that there are no translatable content and does not create a POT file.
hmm I think this is actually less bad than if a POT file is missing, because if it's there but empty you can know the date it was processed but if it's missing then you just don't know why it's not there .... thoughts?
(In reply to Jeff Fearn from comment #2)
That's a good point. I guess this could also be a problem with the Transifex client not being happy with an empty POT file. If you don't like it why import it?
I've written a tool to create the Transifex client config file and I can probably figure out how to include some sort of logic to actually read the POT files instead of just grabbing their names. The other solution, from a Publican POV, would be to have Publican generate some sort of a log file that would tell why a certain POT file wasn't created. I could see that becoming complicated, though, if a POT file once contained content but then later does not (how would that work?).
The problem with a log file is that, IMO, you don't want to check log files in to your source repository, so no one else will know why it's not there.
Empty POT and PO files are valid, translation tools should cope with that.
Actually there is already a check in place that attempts to delete empty pot files, it just doesn't work because the header gets printed out. I'll fix that check so it bases it on the message count as well.
HSS-QE has reviewed and declined this request. QE for this bug will be handled by IED.
fe4c066..3dd294e HEAD -> devel
I created a book, translated a bit of it to German, added a new Chapter with no content, and updated the po as follows:
$ publican update_po --langs=de-DE --firstname=Zac --surname=Dover --firstname.lastname@example.org
Processing file pot/Author_Group.pot -> de-DE/Author_Group.po
Processing file pot/Book_Info.pot -> de-DE/Book_Info.po
Processing file pot/Chapter.pot -> de-DE/Chapter.po
Processing file pot/Preface.pot -> de-DE/Preface.po
Processing file pot/Revision_History.pot -> de-DE/Revision_History.po
Processing file de-DE/Revision_History.xml -> de-DE/Revision_History.xml
The name of the chapter I created was Chapter2.xml. It had no translatable content in it. It does not appear in the above list of files processed by 'publican update_po'.
The fix for this bug has been shipped in publican 3.2.0