views:

242

answers:

3

Hi,

how do you prepare Latex document with a translation... I need 1 multilanguage document. It should be something like:

\section{pl:Costam; en:Something}

Then I'd like to render it in Polish or English...

Thanks in advance, Etam.

A: 

Have you considered the parallel package? Check the docs (PDF link) to see if it is appropriate for your needs.

You can see some other options by searching CTAN for "parallel text" (I didn't have a lot of luck with "multiple languages" and "translation").

dmckee
I need a tool which generates separate documents in different languages...
etam
+1  A: 

You could do this using conditionals, e.g. a \ifdefs. With appropriate macros this need not be utterly horrible to read.

Much better would be use a localisation tool, such a an XLIFF editor. Take a look at the XLIFF tools page. The great strength of going this route is the XLIFF slots directly into standard translators tools like translation memory.

Charles Stewart
A: 

I have the solution!

\newboolean{eng}
\setboolean{eng}{false}
\newboolean{pol}
\setboolean{pol}{true}
\newboolean{rus}
\setboolean{rus}{false}

\newcommand{\lang}[3]
{
    \ifthenelse{\boolean{eng}}{#1}{}\ifthenelse{\boolean{pol}}{#2}{}\ifthenelse{\boolean{ger}}{#3}{}
}

Usage:

\lang{English}{Polski}{Deutch}
etam