I have a large list of symbols and acronyms, which I use with the glossaries package and the makeglossaries program. I write content in more than one language (Portuguese and English, to be more specific) and I wonder if it's possible to write symbol and acronym definitions in more than one language, so that they can be displayed in the glossary and list of acronyms in the same language as the document, or in the language that I choose.

This is an example of what I am looking for

\newglossaryentry{expectation}{type=symbols, name={\ensuremath{\mathbb{E}}}, sort=e, description-en={expectation}, description-pt={expectativa}}
\newacronym{mlp}{MLP}{en={Multi-Layer Perceptron}, pt={Perceptron Multi-Camadas}}

Then I can choose in which language the lists will be printed, e.g. by issuing a command like \printglossaries[en] or \printglossaries[pt].

Are there any packages or programs that are able to manage symbols and acronyms with definitions in multiple languages? Thanks in advance.


There is no inbuilt functionality like this in glossaries, but we can patch it in using babel's \languagename.

  1. For normal multilanguage description, I patched \gls@defglossaryentry to use \@mygls@selectdesc in the default value for description. This macro will try to load the description in the current language and issue a warning if there is none. Note that if you explicitly set description in any entry you will overwrite this and the set value will display regardless of \languagename.
  2. For abbreviations/acronyms this does not really make sense, I think, since the acronym is in one language. We can however add translations to the abbreviation and display them if present (no patching of internal commands needed here). For the displaying part, we define a custom glossary style.



% Create a custom glossary style for abbreviations, printing a translation if present.
        \glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} &
            \ \small(\enquote{\csname glsentrytrans\languagename\endcsname{##1}})
        \glspostdescription\space ##2\tabularnewline

    % a macro for selecting the description in the current language
            \GenericWarning{}{LaTeX Warning:
                No description for `#1' in language `\languagename'}
    % replace the default value of description with \@mygls@selectdesc
    % Add description keys for the different languages.
    \NewDocumentCommand\add@glslangdesckey{m o}{%
                {\IfValueT{#2}{\expandafter\noexpand\csname glsentrydesc#2\endcsname{\noexpand\glslabel}}}%
                \expandafter\noexpand\csname glsentrydesc#1\endcsname
                \expandafter\noexpand\csname Glsentrydesc#1\endcsname
                \expandafter\noexpand\csname glsdesc#1\endcsname
                \expandafter\noexpand\csname Glsdesc#1\endcsname
                \expandafter\noexpand\csname GLSdesc#1\endcsname
    % Add translation keys for the different languages.
    \NewDocumentCommand\add@glslangtranskey{m o}{%
                {\IfValueT{#2}{\expandafter\noexpand\csname glsentrytrans#2\endcsname{\noexpand\glslabel}}}%
                \expandafter\noexpand\csname glsentrytrans#1\endcsname
                \expandafter\noexpand\csname Glsentrytrans#1\endcsname
                \expandafter\noexpand\csname glstrans#1\endcsname
                \expandafter\noexpand\csname Glstrans#1\endcsname
                \expandafter\noexpand\csname GLStrans#1\endcsname

% Define some glossary entries.
    description-english={the number one},
    description-german={die Zahl Eins},
    description-spanish={el número uno},
    description-french={le numéro un},
    description-english={the number two},
    description-german={die Zahl Zwei},
    description-spanish={el número dos},
    description-french={le numéro deux},
    description-german={die Zahl Drei},
    description-spanish={el número tres},

% Define some abbreviations/acronyms.
        translation-english={union of south american nations},
        translation-german={Union südamerikanischer Nationen},
        translation-french={union des nations sud-américaines},
    ]{unasur}{UNASUR}{Unión de Naciones Suramericanas}
        translation-spanish={organización del tratado del atlántico norte (OTAN)},
        translation-french={organisation du traité de l'Atlantique nord (OTAN)},
    ]{nato}{NATO}{north atlantic treaty organization}
        translation-english={and so forth},
        translation-german={und so weiter},
        translation-spanish={y lo demás},
        translation-french={et les autres choses manquent},
    ]{etc}{etc.}{et cetera}


\verb|\languagename| is \texttt{\languagename}



\printglossary[type=main, style=tree]

\printglossary[type=abbreviations, style=custom-long-booktabs]


MWE output

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.