BuildPDFs

Differences between revisions 14 and 18 (spanning 4 versions)
Revision 14 as of 2011-01-06 04:04:17
Size: 2701
Editor: c-24-91-83-115
Comment:
Revision 18 as of 2011-01-06 19:23:11
Size: 3339
Editor: c-24-91-83-115
Comment:
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
'''Note''': Updating the pot file from ''main.tex'' is done manually on an as needed basis by maintainers. po files will be exported from Launchpad translations to trunk and should not be modified. '''Note''': Updating the pot file from ''main.tex'' is done manually on an as needed basis by maintainers. po files will be exported from Launchpad translations to trunk (thanks to Ubuntu Translators) and should not be modified.
Line 19: Line 19:
== Caveat ==
The toolchain does not presently support all linguas (also called "locales"), notably (some) non-Latin ones such as Chinese.
== Caveats ==
 * The toolchain does not presently support all linguas (also called "locales"), notably (some) non-Latin ones such as Chinese.

 * If latex special characters ($, %, _, {, }, &, #) are inserted through a translation unescaped (not preceded by a backslash), the pdf build breaks. Since this is not a general requirement when translating in LP, Ubuntu Translators may do this. We need a script to check all po files for such.
  - '''Fixed''' in trunk bzr revision 62. ''lang_pdfs'' script that builds localized pdfs now runs python script first that validates all valid target po files. ''lang_pdfs'' execution terminates with meaningful output if any unescaped special chars were found before building. If so, they can be fixed in trunk and will update to LP from trunk (once auto sync is turned on).
Line 52: Line 55:
If we had a configured French/Canada lingua (''po/fr_CA.po'' file and {{{fr_CA}}} in ''LINGUAS''), the generated file would be: ''main-fr_CA.pdf''  * The generated Spanish pdf filename is: ''main-es.pdf''.
 * The generated Portuguese/Brazil pdf filename is: ''main-pt_BR.pdf''.
Line 54: Line 58:
And the generated Spanish pdf filename is: ''main-es.pdf''.

Build PDFs

You can build:

  • non-localized pdf
  • localized pdfs (if certain conditions are met)

Note: Localization is a moving target. The instructions are for trunk branch 59 (or thereabouts). Localization does not include images (screenshots and etc.) (yet).

What is a Localized PDF?

At this time, it is a pdf built from:

  • The source tex file (main.tex)

  • With translations from the target lingua's po file (if any -- that is, the lingua-specific po file can contain zero or more translated messages, and whatever is present and matches the source file string ("message") is used).

Note: Updating the pot file from main.tex is done manually on an as needed basis by maintainers. po files will be exported from Launchpad translations to trunk (thanks to Ubuntu Translators) and should not be modified.

What is a non-Localized PDF?

It is a pdf built from the the source tex file with no translations applied.

Caveats

  • The toolchain does not presently support all linguas (also called "locales"), notably (some) non-Latin ones such as Chinese.
  • If latex special characters ($, %, _, {, }, &, #) are inserted through a translation unescaped (not preceded by a backslash), the pdf build breaks. Since this is not a general requirement when translating in LP, Ubuntu Translators may do this. We need a script to check all po files for such.

    • - Fixed in trunk bzr revision 62. lang_pdfs script that builds localized pdfs now runs python script first that validates all valid target po files. lang_pdfs execution terminates with meaningful output if any unescaped special chars were found before building. If so, they can be fixed in trunk and will update to LP from trunk (once auto sync is turned on).

Build Non-Localized PDF

Just run make in the root directory, as in:

make

This produces main.pdf.

Build Localized PDF(s)

Requirements

  1. LINGUAS file in root directory must contain the target locale code.

    • Note: For clarity, let's keep this with one locale per line and in alphabetical order.

  2. po/ must contain a po file for the target locale code.

    • Note: It is probably best that no one create po files and commit them to trunk. The plan is that po files will be exported to trunk (through Launchpad) based on the work of Ubuntu Translators.

Build All Target Lingua PDFs

Build PDFs for all configured target locales as follows.

  1. Be in trunk's root directory
  2. Create all PDFs:
    • ./lang_pdfs

This generates pdf files for each (valid and configured) lingua in LINGUAS file, named as follows: main-<lingua>.pdf

For example, the generated French pdf filename is: main-fr.pdf (because the LINGUAS file contains "fr" and the po/fr.po exists).

  • The generated Spanish pdf filename is: main-es.pdf.

  • The generated Portuguese/Brazil pdf filename is: main-pt_BR.pdf.

Build A Single Lingua PDF

In this case, we execute make and also specify the make target (langpdf). We also must pass a LANG=<lingua> argument to specify the language we want.

For example, to build a Spanish pdf:

make langpdf LANG=es

This generates: main-es.pdf

DesktopTeam/10.10/DeveloperManual/BuildPDFs (last edited 2011-01-11 22:17:14 by c-24-91-83-115)