A problem that sometimes arises with constructing packages, is enabling translations.

Currently I maintain two packages foo-nl.sty (Dutch version) and foo-en.sty (English version). A problem with this approach is of course that one needs to synchronize the two packages, and there is no mechanism to check if this is the case.

What other options are there to provide translations. It would be nice to automatically set the language as well, based on the \usepackage[dutch]{babel} command in the main document.


1 Answer 1


The translations package was developed for exactly this purpose. In the package translations are provided for keywords for each language with


One should probably also add


which is used if a babel language is chosen for which no translation is provided.

Translations declared this way can be used with


This command is expandable so that it also works in section titles that are used as hyperref bookmarks, for example.

Here is a short example package:



% a command that's translated according to the provided translations:

% the translations:
% the fallback is used for languages where no specific translation is provided
\DeclareTranslationFallback {mypackage-title}{My title}
\DeclareTranslation{English}{mypackage-title}{My title}
\DeclareTranslation{Dutch}  {mypackage-title}{Mijn titel}





% > \foo=macro:
% ->Mijn titel.
% l.27 \show\foo



% > \foo=macro:
% ->My title.
% l.37 \show\foo


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .