[Tex/LaTex] Multilingual class/style file

babellanguagespackage-writing

I'm writing some templates and class files that need to use some strings of text, say names for theorems, lemmas, etc., and I would like to provide the ability to easily switch the language in which these pieces of text are written; much like Babel does for standard LaTeX document classes.

The question is what would be the preferred way to implement this? Is there a way to make it work nicely together with Babel (e.g. somehow “read” the chosen language in babel options and use this for my own text labels)?

Best Answer

You can provide a switch in your class for language or use it locally if you wish. You can add 'captions' as you wish, using babel's mark-up for the language, for example for Greek:

\addto\captionsgreek{%
  \def\prefacename{Pr'ologos}%
  \def\refname{Anafor'es}%
  \def\abstractname{Per'ilhyh}%
  \def\bibname{Bibliograf'ia}%
  ...
  \def\proofname{Ap'odeixh}%
  \def\glossaryname{Glwss'ari}% 
  }