Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Suppose I'm preparing LaTeX package to give the abstraction of admonition boxes (warning, error, tip, note, fyi, ...).

I'd like to have theses strings internationalized. I wouldn't appreciate the following solutions:

  • "generic" box, let the user give the title and icon.
  • add an option to your sty file so that the user can configure the language
  • make many sty files suffixed by the language code

The "babel" package is capable of defining some i18n strings (Table of Contents, Table des matières, ...).

Is it possible to integrate the strings used in my package with a i18n system?

Sorry but searching for latex, i18n, babel, interface, integration or whatever don't give me useful results (most people have doubts on how to get babel to work in their documents).

Thanks in advance.

share|improve this question
    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Torbjørn T. Nov 17 '11 at 16:32
    
For ignorants like me: What the heck are "i18n" strings? –  Daniel Nov 17 '11 at 20:05
    
1  
add comment

migrated from stackoverflow.com Nov 17 '11 at 16:18

This question came from our site for professional and enthusiast programmers.

2 Answers

You could try the »translator« package that is shipped with the beamer class. It is described in Section 25 of the class user guide.

share|improve this answer
add comment

Maybe a late answer, but babelallows you to have separate .cfg files with the name of the language (UKenglish.cfg, norsk.cfg, swedish.cfg, etc.) and use the babel macro addto{<caption_name>}.

For example, I have a file UKenglish.cfg in my texmf-local directory, with the following definition used by my own macros:

%% UKenglish.cfg
%% Local config file UKenglish.cfg used by babel

%% to add an entry to english
\addto{\captionsUKenglish}{%
    \def\Companynumbername{company number}%
    \def\shVersion{Version}%
    \def\shversion{version}%
}

And I have a corresponding norsk.cfg to cover the two languages I mostly use.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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