Edit Links |
LyX /
I18nLabelsCategories: i18n << Tables | Page list | DocumentationDevelopment >>About internationalized labels
IntroductionMost of the labels, like "Table of contents", are automatically translated into the document language. This is done by the LaTeX-package babel, that is always loaded by LyX in the background. But babel doesn't translate all labels, that are introduced by some document classes. These labels need to be translated manually. Method of translationEnvironmentsLabels are often part of a LaTeX-environment. Environments appear in LaTeX as \begin{environment name} To translate a label, we have to redefine the environment. This is done in the preamble with the command \renewenvironment{environment name}{begin command}{end command} For begin and end we need a new environment with the new label. \newtheorem{exa}{Beispiel} A theorem is a special form of an environment. exa is the name of our environment and Beispiel its label. \renewenvironment{example}{\begin{exa}}{\end{exa}} In summary we overwrote the existing environment with a new one. All that we have to know, is the name of the existing environment and the form of its definition (theorem or not). FloatsLabels of floats can easily be changed with the command \floatname{name of float}{label} LabelsTo change labels that are automatically translated by the LaTeX-package babel, you need to load it in the preamble together with the language options used in your document. For example when you have a document that uses the new german ortography call babel with the preamble line \usepackage[ngerman]{babel} The new label name is set by this preamble line construct: \addto\captionsngerman{\renewcommand{\indexname}{Stichwortverzeichnis}} This preamble line replaces babels german index name with "Stichwortverzeichnis". The command \captions<language> must be adjusted according to the used language. So it is for an english document the command \captionsenglish. To change another label than the index, replace the command \indexname by \<label>name. A list of the possible names can be found here: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=fixnam To change for example the name of the label "Figure" in french by "Image" you need these preamble lines: \usepackage[french]{babel} Preamble commands for special LaTeX-classesIn the following, all labels are translated into french. Every section includes a downloadable example file, so that you can easily copy the code from the preamble and replace the french names by the one you need. Algorithm-floatExample file: lang-algorithm.lyx \floatname{algorithm}{Algorithme} AMS-documentclassesExample file: lang-ams.lyx --this example file doesn't work correctly in LyX 1.5 because of Case environment In the original definition, all environments are numbered within the section number. To have this for the redefined environments, add a \numberwithin command for every environment, e.g. \numberwithin{theo}{section} as it is done in the example file.
Beamer-presentationsFirst approachExample file: lang-beamer.lyx
Second solution (no redefinitions needed)Till Tantau created a package name translator, currently not sufficiently documented to deserve a real publication as a package. To have it working:
revision after the last stable release (3.06);
|