Bug 1056196 - Building a translated book using a non-default config file results in a wrong TOC entry
Summary: Building a translated book using a non-default config file results in a wrong...
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: 4.0
Hardware: Unspecified
OS: Unspecified
Target Milestone: 4.1
Assignee: Jeff Fearn 🐞
QA Contact: Ruediger Landmann
Depends On:
TreeView+ depends on / blocked
Reported: 2014-01-21 16:44 UTC by Petr Bokoc
Modified: 2014-03-04 22:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2014-03-04 22:30:13 UTC

Attachments (Terms of Use)

Description Petr Bokoc 2014-01-21 16:44:51 UTC
Short description of problem:
When trying to publish a translated book using the non-default config takes the TOC entry name from the default Book_Info file, regardless of whether it's included or not.

Long description:
The Fedora Installation Guide and Fedora Installation Quick Start Guide share the same repository. When building, using the default publican.cfg config builds the full IG, and an alternate config - quickstart.cfg - builds the Quick Start Guide.

The quickstart.cfg config specifies the book's mainfile as Installation_Quick_Start_Guide.xml. This XML links (xi:include) Article_Info.xml containing book information such as its title.

Now, I want to publish the Czech translation of the Quick Start Guide to docs.fedoraproject.org, embedding the site's TOC (--embedtoc). The Article_Info.xml file is translated in cs-CZ/Article_Info.po, and the title string looks like this:
#. Tag: title
#, no-c-format
msgid "Installation Quick Start Guide"
msgstr "Stručná příručka instalace"

The Book_Info file, which is only included in the full Installation Guide and NOT in the Quick Start Guide, has the title string untranslated:
#. Tag: title
#, no-c-format
msgid "Installation Guide"
msgstr ""

When I attempt to publish the cs-CZ version of the Quick Start Guide, the book builds correctly and its title is translated, the string being taken from cs-CZ/Article_Info.po. However, the TOC entry ignores this and takes the title specified in cs-CZ/Book_Info.po, which is untranslated, and the TOC therefore displays the guide as "Installation Guide", instead of "Stručná příručka instalace". Translating the title string in cs-CZ/Book_Info.xml and building again changes this entry. (tried it on Publican 4.0 on Fedora 19; apparently Publican 2.8 does not display the TOC entry in the locally built file)

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. clone install-guide.git[1], checkout branch F20
2. publican build --publish --embedtoc --langs=cs-CZ --formats=html-single --config=quickstart.cfg
3. open publish/cs-CZ/Fedora/20/html-single/Installation_Quick_Start_Guide/index.html
4. on the top of the html file, check the table of contents entry

Actual results:
the TOC entry at the top of the file reads "Installation Guide" - the title string in cs-CZ/Book_Info.po. This file is not included anywhere in this variant of the guide. The actual book title as it shows on the title page is correctly taken from cs-CZ/Article_Info.po, only the TOC entry is wrong.

Expected results:
the TOC entry reads "Stručná příručka instalace" - the string that the title is translated to in cs-CZ/Article_Info.po

Additional info:
I'm reportig this for Publican 4, but the bug appears in Publican 2.8 as well. This is a big issue, because right now Publican 2.8 is necessary for publishing documents to docs.fedoraproject.org - newer Publican versions break the site.

[1] https://git.fedorahosted.org/cgit/docs/install-guide.git/

Comment 1 Petr Bokoc 2014-01-21 17:57:18 UTC
I think I forgot to clarify: in the default locale (en-US), building the book with --config=quickstart.cfg works normally, the TOC entry is generated from the title in en-US/Article_Info.xml as it should be. The problem described above only happens when building a different locale.

Comment 2 Jeff Fearn 🐞 2014-03-03 06:19:07 UTC
Hi Petr, it looks like a configuration issue to me.

Can you try adding the following line to quickstart.cfg and testing it?

type: Article

Comment 3 Petr Bokoc 2014-03-04 17:50:01 UTC
Hi Jeff, you're right. Setting the type to Article fixes the issue - so I guess we can close this.

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