I'd like to keep one of my presentations in German and English and have defined a corresponding boolean variable withifthen and a command to typeset either the German or the English text.
Is there an easy way to evaluate the global options (\documentclass[ngerman]{article}) one defines for e.g. babel?
\documentclass{minimal}
\usepackage{ifthen}
\newboolean{mothertongue}
\setboolean{mothertongue}{true}
\newcommand{\tr}[2]{\ifthenelse{\boolean{mothertongue}}{#1}{#2}}
\begin{document}
\tr{Deutsch}{English}
\end{document}
Based on egregs comment I updated my example, however I get only the English text.
\documentclass[ngerman]{scrartcl}
\usepackage{ifthen,babel}
\newcommand{\tr}[2]{\ifthenelse{\equal{\languagename}{ngerman}}{#1}{#2}}
\begin{document}
\tr{deutsch}{english}
\languagename
\end{document}

\bbl@main@languageand the current name is available as\languagename. You can also look at http://tug.org/pracjourn/2007-1/gregorio/ – egreg Sep 06 '13 at 17:27ifthendocumentation\equalshould do thecorrect comparison. – Uwe Ziegenhagen Sep 06 '13 at 17:51\languagenamehas category code problems; look at theiflangpackage by Heiko Oberdiek that wasn't available when I wrote that paper. – egreg Sep 06 '13 at 18:00\iflanguageeither, because it compares languages in the TeX sense, ie, hyphenation patterns. – Javier Bezos Sep 07 '13 at 14:45