12.2. Quick Start

The procedure shown in Section 1.1, “Quick Start” is assumed to have already been performed, but the TRANSLATOR option must be enabled in the textproc/docproj port. If that option was not enabled, display the options menu and enable it, then reinstall the port:

# cd /usr/ports/textproc/docproj
# make config
# make clean deinstall install clean

This example shows the creation of a Spanish translation of the short Leap Seconds article.

Procedure 12.1. Install a PO Editor
Procedure 12.2. Initial Setup

When a new translation is first created, the directory structure and Makefile must be created or copied from the English original:

  1. Create a directory for the new translation. The English article source is in ~/doc/en_US.ISO8859-1/articles/leap-seconds/. The Spanish translation will go in ~/doc/es_ES.ISO8859-1/articles/leap-seconds/. The path is the same except for the name of the language directory.

    % svn mkdir --parents ~/doc/es_ES.ISO8859-1/articles/leap-seconds/
  2. Copy the Makefile from the original document into the translation directory:

    % svn cp ~/doc/en_US.ISO8859-1/articles/leap-seconds/Makefile \
        ~/doc/es_ES.ISO8859-1/articles/leap-seconds/
Procedure 12.3. Translation

Translating a document consists of two steps: extracting translatable strings from the original document, and entering translations for those strings. These steps are repeated until the translator feels that enough of the document has been translated to produce a usable translated document.

  1. Extract the translatable strings from the original English version into a PO file:

    % cd ~/doc/es_ES.ISO8859-1/articles/leap-seconds/
    % make po
  2. Use a PO editor to enter translations in the PO file. There are several different editors available. poedit from editors/poedit is shown here.

    The PO file name is the two-character language code followed by an underline and a two-character region code. For Spanish, the file name is es_ES.po.

    % poedit es_ES.po
Procedure 12.4. Generating a Translated Document
  1. Generate the translated document:

    % cd ~/doc/es_ES.ISO8859-1/articles/leap-seconds/
    % make tran

    The name of the generated document matches the name of the English original, usually article.xml for articles or book.xml for books.

  2. Check the generated file by rendering it to HTML and viewing it with a web browser:

    % make FORMATS=html
    % firefox article.html

All FreeBSD documents are available for download at http://ftp.FreeBSD.org/pub/FreeBSD/doc/

Questions that are not answered by the documentation may be sent to <freebsd-questions@FreeBSD.org>.
Send questions about this document to <freebsd-doc@FreeBSD.org>.