# Managing multiple translation of a single document

Consider that you are working on a standard that should be translated into some other languages. The document structure (figures, table structures, ...) is constant among languages. Is there any facility/technique/strategy/package to streamline multilingual documents production?

Is it possible to use a gettex-like method in (la)tex?

-
babel or polyglossia, maybe? –  Vafa Khalighi Jun 22 '12 at 6:16
look at one of the packages parcolumns, paracol, parallel or parrun or other related packages –  matth Jun 22 '12 at 8:37
translator package which comes with beamer provides some tools for automatic translations. –  Ignasi Jun 22 '12 at 16:42
@Reza: Actual I'm thinking about some supporting scripts for such a task. Are you familiar with ruby (or rake)? –  knut Jun 24 '12 at 20:35

One possible problem you may have is keeping the different language versions up-to-date with respect to each other.

One possible solution is to write your document as a parallel text, with the different languages mixed together in small lumps so that the writer sees multiple languages in the same window.

A good (simple) way to handle this is to use the comment' package. Here's the outline of an example using English and Portuguese:

English master document:

\includecomment{xengl}
\excludecomment{xport}
\input{commonbody}


Portuguese master document:

\excludecomment{xengl}
\includecomment{xport}
\input{commonbody}


Common body:

\begin{xengl}
Some English text, maybe up to a whole paragraph or list
\end{xengl

\begin{xport}
Algum texto em português, talvez até um parágrafo
\end{xport}


Common, language-independent text can live outside of either environment, and will be included in both language versions.

-

Preamble: I hope I understand you correct: You have multiple documents, each document is written in one language, the content is the same. There is no language mixture inside one document.

I would create a directory per language. The I separate the document in small files (a file per chapter, perhaps per section. tables and figures in there own files).

Something like this:

english
english/main
english/preamble
english/chapter1
english/chapter2
german
german/main
german/preamble
german/chapter1
german/chapter2
french
french/main
french/preamble
french/chapter1
french/chapter2


After this you need a diff-tool to compare the directories and files. The sync comments inside the document align the texts during comparison.

For the graphics I would create:

english/graphics
german/graphics
french/graphics
graphics


graphics contains the language independent graphics. If you have language depending graphics (e.g. with legends) you can add the to the subdirectories.

Then you define:

\graphicspath{{german/graphics}{../graphics}}


With a bit more work, you may write a script, that creates a new bi- (or more) lingual document using the parallel.sty. The you can use a printed document version instead the diff tool.

-

There is another way to support internationalization within your LaTeX documents. For instance, below is the support for english and german languages I made some time ago:

\RequirePackage{ifthen}

\newif\ifen
\newif\ifde

\newcommand{\en}[1]{\ifen#1\fi}
\newcommand{\de}[1]{\ifde#1\fi}


Next, if you need you can define different commands for months, date formats, etc:

\newcommand{\jan}{%
\en{January}%
\de{Januar}%
}


Finally, in text you can write something like this:

\en{English text.}
\de{Deutscher Text.}


After all, when you've created the whole document you can simple switch between languages setting in the document preamble either \entrue or \detrue`. All this allows you to keep multilingual texts up-to-dated near each other.

-