Generating multiple versions of a document using options

There's always docstrip, which lets you distinguish one code from another using special comments (called guards) and also have code which is common to both.

In my opinion, the advantage of this method over the conditionals is that it's fairly simple to add more languages avoiding the hassle of nesting conditionals.

For instance, you can have a source file (let's call it source.dtx, but any other name will do):

\documentclass{book}
\begin{document}

%<english>\chapter{LITERATURE}
%<spanish>\chapter{LITERATURA}

%<*english>
\emph{The Tau Manifesto} is dedicated to one of the most important numbers in
mathematics, perhaps \emph{the} most important: the \emph{circle constant} relating
the circumference of a circle to its linear dimension. For millennia, the circle has
been considered the most perfect of shapes, and the circle constant captures the
geometry of the circle in a single number. Of course, the traditional choice for
the circle constant is $\pi$--but, as mathematician Bob Palais notes in his
delightful article ``$\pi$ Is Wrong!'', $\pi$ \emph{is wrong}. It's time to set
things right.
%</english>

%<*spanish>
\emph{El Manifiesto de Tau} está dedicado a uno de los números más importantes en
matemáticas, quizás \emph{el} más importante: la \emph{constante de círculo} que relaciona
la circunferencia de un círculo con su dimensión lineal. Durante milenios, el círculo ha
sido considerado la forma más perfecta, y la constante del círculo captura la
geometría del círculo en un solo número. Por supuesto, la elección tradicional para
la constante de círculo es $\pi$--pero, como señala el matemático Bob Palais en su
artículo encantador ``$\pi$ Is Wrong!'', $\Pi$ \emph{es incorrecto}. Es hora de arreglar las cosas.
%</spanish>

\end{document}

(sample text taken from here and Google-Translated to Spanish)

then you only need a so-called “installation file”:

\input docstrip % Loads the docstrip program
% Optional switches
\askforoverwritefalse % Allows it to overwrite older files without asking
\keepsilent % Reduces verbosity
\nopreamble % Removes preamble
\nopostamble % removes postamble
% Separating sources:
\generate{%
  %
  \file{english.tex}{%
    \from{source.dtx}{english}%
  }%
  %
  \file{spanish.tex}{%
    \from{source.dtx}{spanish}%
  }%
  %
}
% Exiting
\endbatchfile

which will generate an english.tex file from the parts that are marked as <english> in the source.dtx and another one called spanish.tex from the parts marked with <spanish> in the source.dtx. The parts of the source.dtx which aren't marked go to both output files.

To execute this you only need to run TeX on the installation file:

> pdftex installation.ins

The generated english.tex will look like this:

\documentclass{book}
\begin{document}

\chapter{LITERATURE}

\emph{The Tau Manifesto} is dedicated to one of the most important numbers in
mathematics, perhaps \emph{the} most important: the \emph{circle constant} relating
the circumference of a circle to its linear dimension. For millennia, the circle has
been considered the most perfect of shapes, and the circle constant captures the
geometry of the circle in a single number. Of course, the traditional choice for
the circle constant is $\pi$--but, as mathematician Bob Palais notes in his
delightful article ``$\pi$ Is Wrong!'', $\pi$ \emph{is wrong}. It's time to set
things right.


\end{document}

You could use an approach like the following, I use it to create various versions of a CV document.

\documentclass{minimal}

\usepackage{ifthen}
\newboolean{somevariable}
\setboolean{somevariable}{false}

\begin{document}

\ifthenelse{\boolean{somevariable}}{Text if somevariable is true.}{Text if somevariable is false.}

\end{document}

You can use the iflang package:

\documentclass{article}
\usepackage[english,ngerman]{babel}
\usepackage{iflang}
\begin{document}

\IfLanguageName{english}{This is english}{This is not english}

\IfLanguageName{ngerman}{Das ist deutsch}{Das ist nicht  deutsch}

\selectlanguage{english}

\IfLanguageName{english}{This is  english}{This not english}

\IfLanguageName{ngerman}{Das ist deutsch}{Das ist nicht deutsch}

\end{document}

enter image description here