Bug 961413 - Publican creates blank POT files
Publican creates blank POT files
Product: Publican
Classification: Community
Component: publican (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: 3.2
: ---
Assigned To: Jeff Fearn
Depends On:
  Show dependency treegraph
Reported: 2013-05-09 11:02 EDT by Eric Christensen
Modified: 2013-08-09 00:49 EDT (History)
4 users (show)

See Also:
Fixed In Version: 3.2.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-08-09 00:49:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Eric Christensen 2013-05-09 11:02:44 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.
Comment 2 Jeff Fearn 2013-07-04 01:55:17 EDT
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?
Comment 3 Eric Christensen 2013-07-08 09:46:51 EDT
(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?).
Comment 4 Jeff Fearn 2013-07-08 21:02:53 EDT
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.
Comment 5 Jeff Fearn 2013-07-12 00:25:48 EDT
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.
Comment 6 HSS Product Manager 2013-07-12 00:37:32 EDT
HSS-QE has reviewed and declined this request. QE for this bug will be handled by IED.
Comment 7 Jeff Fearn 2013-07-12 01:23:20 EDT
To ssh://git.fedorahosted.org/git/publican.git
   fe4c066..3dd294e  HEAD -> devel
Comment 8 Zac Dover 2013-07-22 05:19:58 EDT
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 --email=zdover@redhat.com
	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'.

Comment 9 Jeff Fearn 2013-08-09 00:49:00 EDT
The fix for this bug has been shipped in publican 3.2.0

Note You need to log in before you can comment on or make changes to this bug.