Creating Multiple Language Presentation with Latex Beamer

I love creating presentation with latex beamer. The result is awesome. The problem is, I'd like to provide my presentation in english and in another language.

What are the tips and trick to do this? Should I manually comment the english string, translate it and compile it to have result in another language? Are there any better mechanism?

What I meant by tips and tricks are the fast and practical way to do it.

-

migrated from stackoverflow.comSep 12 '12 at 11:54

This question came from our site for professional and enthusiast programmers.

Can you make your question a bit more concrete than tips and tricks please? –  Flexo Sep 11 '12 at 7:47
Use \newif to create a conditional compilation. For each frame, provide the contents in all languages (that you want), each must be sandwiched with conditional macro. Later, you can select which language you want to activate by turn on/off it from the preamble. –  kiss my armpit Sep 12 '12 at 12:04
How about setting a variable for the language and including content files according to it? –  ℝaphink Sep 12 '12 at 12:13

The following should do the trick:

Create a new package languagechooser.sty with the content:

\newcommand{\english}[1]{}
\newcommand{\german}[1]{}

\DeclareOption{english}{\renewcommand{\english}[1]{#1}}
\DeclareOption{german}{\renewcommand{\german}[1]{#1}}
\ProcessOptions


Now create your beamer presentation with the content provided for your favorite languages like this

\documentclass{beamer}
\usepackage[german]{languagechooser}

\begin{document}

\begin{frame}{\english{English title}\german{Deutscher Titel}}
\english{This ist some english content.}
\german{Dies ist ein deutscher Inhalt.}

\begin{description}
\item[\german{Hallo}\english{hello}] \german{Welt}\english{world}.
\end{description}
\end{frame}

\end{document}


By altering the option of your new package, TeX will consider only content in that language. However, it is a shame that you have to write everything twice (once for each language), but as long as there is no major improvement in automatic translations, I think this is unpreventable.

-