I know this question has already been answered, but I wanted to share my two cents.
I was searching for the same exact thing as yegor256, and starting from the pointers in other answers I put together a small sty file that fits my needs. It supports an arbitrary number of different languages in the same document.
%
% Environment settings
%
\newcommand{\setdoclang}[2]
{
\main@language{#2}
\def\doclang{#2}
\def\doclangshort{#1}
}
\setdoclang{en}{english}
%
% Multilingual support commands
%
\newcommand{\langif}[3]
{
\ifthenelse{\equal{#1}{\doclang} \or \equal{#1}{\doclangshort}}
{#2}
{#3}%
}
\newcommand{\lang}[2]{\langif{#1}{#2}{}}
\newcommand{\sectionlang}[2]{\lang{#1}{\section{#2}}}
\newcommand{\subsectionlang}[2]{\lang{#1}{\subsection{#2}}}
\newcommand{\subsubsectionlang}[2]{\lang{#1}{\subsubsection{#2}}}
It's useful because it synchronizes also the correct language for the babel
package, such that your document will always have the correct locale settings. You just have to write a code like this in your tex:
% MULTILINGUAL SUPPORT
\usepackage[italian,english]{babel} %enables babel to every lang supported by your document
\usepackage{multilanguage} % import the file with the above definitions
\setdoclang{it}{italian} % set short and long language codes
% the second one must be known by babel
%\setdoclang{en}{english}
% END MULTILINGUAL SUPPORT
After that you can mix in your regular document parts that shows up in every language (i.e. document structure, images, ...) and parts that shows up only for certain languages, like this:
% Sections, subsections, subsubsections:
\sectionlang{it}{Sezione 1} % in the first parameter you can freely use
% both short or long language codes
\sectionlang{english}{Section 1}
% Strings that are displayed only in a certain language
\lang{it}{Questa stringa appare solo in italiano.}
\lang{en}{This string shows up only in English.}
% When you have only two languages, you can simply rely on this if-else
% construct
\langif{it}{If vero: questo e' italiano.}{Else: this is for any language
different from Italian.}