No edit summary |
|||
Line 2: | Line 2: | ||
After a guide has been translated on Zanata, the language team has to make a thorough review of all the messages in order to correct and finally approve them. Zanata is a tremendous tool both for translating and reviewing, nevertheless, it is sometime difficult to deal with some aspects such as punctuation, verb tenses, and so on, without viewing both the original and the translated messages in context. Depending on whether the message is an image caption, or a list item, or the content of a message box,or includes a internal link (section, chapter, figure,…) as part of the sentence itself, translation may vary a bit? | After a guide has been translated on Zanata, the language team has to make a thorough review of all the messages in order to correct and finally approve them. Zanata is a tremendous tool both for translating and reviewing, nevertheless, it is sometime difficult to deal with some aspects such as punctuation, verb tenses, and so on, without viewing both the original and the translated messages in context. Depending on whether the message is an image caption, or a list item, or the content of a message box,or includes a internal link (section, chapter, figure,…) as part of the sentence itself, translation may vary a bit? | ||
Having the guide in the form of a translated book may be a precious help for reviewers. This page explains how to build it. | Having the guide in the form of a translated book may be a precious help for reviewers. This page explains how to build it. | ||
{{admon/warning|This page doesn't explain how to create a book from scratch. It is only a kind of shortcut for translation teams to quickly have a preview of their work before the final proofreading and approval of messages. To learn how to create a book from scratch, please refer to the Publican manual available in the Publican-doc package.}} | |||
==Installing Publican == | ==Installing Publican == |
Revision as of 15:34, 8 April 2016
After a guide has been translated on Zanata, the language team has to make a thorough review of all the messages in order to correct and finally approve them. Zanata is a tremendous tool both for translating and reviewing, nevertheless, it is sometime difficult to deal with some aspects such as punctuation, verb tenses, and so on, without viewing both the original and the translated messages in context. Depending on whether the message is an image caption, or a list item, or the content of a message box,or includes a internal link (section, chapter, figure,…) as part of the sentence itself, translation may vary a bit? Having the guide in the form of a translated book may be a precious help for reviewers. This page explains how to build it.
Installing Publican
The tools used to build the Fedora Guides is Publican. Install it with:
su -c 'dnf install publican-doc publican-doc'
Configuring Publican
Before using Publican, you should at least set the user's defaults which are: firstname, surname, email, formats, lang, langs. Please refer to the relevant page the Publican User's Gude in /usr/share/doc/publican-doc/en-US/index.html.
Getting the Original Folders and Files
Normally, you can create a book with publican using the publican create
command.
This command creates a directory structure which is described in the publican manual. Here is this structure:
- publican.cfg
- en-US (directory)
- Test_Book.xml
- Test_Book.ent
- Revision_History.xml
- Preface.xml
- Chapter.xml
- Book_Info.xml
- Author_Group.xml
- images (directory)
- icon.sv
The Chapter.xml file is a template for creating chapter files. Chapter files contain the content that make up a book.
In our situation, we do not need to create the book as it has already been created by the author. In fact, we can get the above directory structure, including the chapters that have been added by the author from the [git.fedorahosted.org] site.
Once in this site, find your guide and click its name on the left side the screen. Then in the guide's page, choose the branch (generally the newer one) that you have translated. In the branch's page, click on the line corresponding to the last commit. The new displayed page should look like the following:
![](/w/uploads/thumb/1/14/Branch-page-fedorahosted.png/300px-Branch-page-fedorahosted.png)
In the download section, click on one of the downloadable archives to download it.
Extract the content in any folder you want.
Preparing the translation files
- Open a terminal and change to the root directory of the guide. The one that contains the directory structure presented above.
- As a standard user, use the following command:
$ publican trans_drop
With this command, Publican creates a new subdirectory, named trans_drop/. The trans_drop/ subdirectory contains a snapshot of the source files of the document. When the trans_drop/ directory is present in a documentation project, Publican uses its content as the basis for the commands documented later in this procedure.
- Generate portable object template (POT) files from the XML files, using the following command:
$ publican update_pot
If this is the first time that POT files have been created for this document, Publican creates a new subdirectory, named pot. The pot subdirectory holds a POT file for each XML file in the document. If Publican has created POT files for this document previously, Publican updates the existing POT files to reflect any changes in the XML since the POT files were last updated.
- Generate portable object (PO) files from the POT files to begin translation into a particular language:
$ publican update_po --langs=language_code
If this is the first time that PO files have been created for a particular language, Publican creates a new subdirectory, named with the language code that you specified with the --langs= option. This subdirectory holds a PO file for each POT file in pot subdirectory, plus a Revision_History.xml file that tracks the history of this particular translation.
Replace the .po files in the <language-code> directory with the translated ones
- Go to the Zanata, log in, and open your project/branch/language page. Select your language and download the po files using the Downlad All (zip) link shown in the following picture:
![](/w/uploads/thumb/2/25/Zanata-download-po.png/300px-Zanata-download-po.png)
- Extract the archive
- Copy/paste the po files from the archive to replace the original ones.
Your are now ready to build your translated book.
Building the Translated Book
To build the book use the following command:
$ publican build --formats=html,pdf --langs=fr
Of course, replace the language code (here fr) with your one and add – or remove – formats you want.
Normally if everything goes well – but real life is not that easy —, the resulting books should be placed in a tmp subdirectory.
Troubleshooting
Fuzzy Messages
If you plan to have a book to see the messages in context in order to approve them, you may still have some fuzzy messages let in the po files. Unfortunately, this makes the build process crash. Fortunately, Publican gives information about where the trouble occurred, e.g.:
Fusionner fr/After_Installation.po >> trans_drop/After_Installation.xml -> tmp/fr/xml_tmp//After_Installation.xml AVERTISSEMENT : message approximatif dans le fichier PO. 45: "Both of these tools will allow you to configure user-specific s...
Here the message is in French and it means: WARNING: Fuzzy message in the po file.
In such case, edit the po file and remove all the #fuzzy lines you find in After_Installation.po. Save your file and use the building command again.
Bad XML source files
In some cases, you may get this kind of message:
DTD Validation failed for '/home/jaaf/Documents/install-guide-625e08c186c09c1abce89f3f0bf37c37563c7880/tmp/fr/xml/Installation_Guide.xml': Booting_the_Installation.xml:105: validity error : Element keycombo content does not follow the DTD, expecting (keycap | keycombo | keysym | mousebutton)+, got (keycap CDATA keycap)
Normally it should not happen but life is different. In this case, correct the fault as you can. For example, just remove the troublesome <keycombo> tag.
After that, as you have changed the xml files, you should rerun the update_pot and update_po commands above. Then rerun the build command.