Skip to content

install po4a

Joseph Cayouette edited this page Aug 30, 2022 · 3 revisions

Introduction

AsciiDoc is not supported by any translation tool: WebLate, Transifex, OmegaT, WorldTrans, etc.

[po4a](https://po4a.org/) to the rescue!

po4a can convert AsciiDoc to gettext (.po files) and back.

Installing po4a

po4a >= 0.62 (we are using 0.66) is required for the AsciiDoc to gettext and back to work, otherwise the PDF will not be correctly rendered.

Before installing ensure you have the required perl dependencies:

sudo cpan install Locale::gettext
sudo cpan install Text::WrapI18N
sudo cpan install Term::ReadKey
sudo cpan install Unicode::GCString

In the case of openSUSE/SLES, if po4a from the operating system, or some other repository, is installed, make sure you allow vendor change for the right package to be picked up: zypper up --allow-vendor-change po4a

Troubleshooting

If your PDF is missing content, make sure po4a >= 0.62 is installed.

If you try to make antora-uyuni and it fails with an error like any of these (or all of these), then either po4a is not installed, or it’s too old of a version. Make sure po4a is installed:

/home/user/uyuni-docs//use_po.sh: line 75: po4a: command not found

or

sed -E  -e 's/\*\*\*\*\*\ xref\:(.*)\.adoc\[(.*)\]/include\:\:modules\/quickstart-public-cloud\/pages\/\1\.adoc\[leveloffset\=\+4\]/' -e 's/\*\*\*\*\ xref\:(.*)\.adoc\[(.*)\]/include\:\:modules\/quickstart-public-cloud\/pages\/\1\.adoc\[leveloffset\=\+3\]/' -e 's/\*\*\*\ xref\:(.*)\.adoc\[(.*)\]/include\:\:modules\/quickstart-public-cloud\/pages\/\1\.adoc\[leveloffset\=\+2\]/' -e 's/\*\*\ xref\:(.*)\.adoc\[(.*)\]/include\:\:modules\/quickstart-public-cloud\/pages\/\1\.adoc\[leveloffset\=\+1\]/' -e 's/\*\ xref\:(.*)\.adoc\[(.*)\]/include\:\:modules\/quickstart-public-cloud\/pages\/\1\.adoc\[leveloffset\=\+0\]/' -e 's/\*\*\*\*\ (.*)/==== \1/' -e 's/\*\*\*\ (.*)/=== \1/' -e 's/\*\*\ (.*)/== \1/' -e 's/\*\ (.*)/= \1/' modules/quickstart-public-cloud/nav-quickstart-public-cloud-guide.adoc > translations/es/modules/quickstart-public-cloud/nav-quickstart-public-cloud-guide.pdf.es.adoc
bash: translations/es/modules/quickstart-public-cloud/nav-quickstart-public-cloud-guide.pdf.es.adoc: No such file or directory
make: *** [Makefile.es:135: modules/quickstart-public-cloud/nav-quickstart-public-cloud-guide.pdf.es.adoc] Error 1

Now that the toolchain is installed proceed with building docs! Building Documentation

Clone this wiki locally