I'm using LaTeX in my company to write formal reports to customers. This class contain a lot of preset for my company including texts (like different standard intro and some label about the right to share the doc).

You can see an example of it here https://github.com/ygini/LaTeXForITDocumentation/tree/master/sample

Now I need to work on the multilingual version of the class (for now, french and english but soon hopefully more).

What would be the best option to handle this and keep the final tex file as simple as possible?

Some texts are created insides commands, so the langage selection must applied at class loading.

Ideally I would like a scenario where french is used as default unless another option is set during the class load.

I've tried a lot of option with options, kvoptions, custom translation file like this one https://github.com/ygini/curriculum/blob/master/translation.sty

Nothing works correctly from the class. I endup with dates translated but not commands, or dates translated but commands show all languages on a raw.

What would be the best solution here to create a class with the following specs: - exact same design (I don't want one class per langage since only the text will chance) - support localization for headers present on all pages - support localization for big intro texts - can be triggered via a class load argument - if possible, support one default value

I've spent hours on this without any viable solution…


Question isn't broad, it's a really specific one with the whole context provided so you can understand what I'm trying to achieve and eventually reroute me.

Same question with less words:

I need to write a class, not a document, that will display some standards text in headers, and this class need to support multiple languages. So, I want to know how am I supposed to implement a class that will accept language options that will be used by babel and by my headers.

  • Welcome to TeX.SE! – Cragfelt Dec 12 '17 at 8:49
  • 1
    On the right side of your question, you'll find some Related questions which can help. On ctan you can find several packages related with Multi-lingual documents. I'd suggest looking at translator and translations packages. – Ignasi Dec 12 '17 at 8:57
  • Imho your question is to vage and too broad. Regarding setting french as default see tex.stackexchange.com/questions/147243/… – Ulrike Fischer Dec 12 '17 at 10:11
  • 1
    You might want to have a look at my TUGboat article on localisation of TeX documents. – Nicola Talbot Dec 12 '17 at 11:45
  • Question updated, it's about a class, not a document. All answers and docs I've found until now are about document translation. I've custom labels in the class that I need to translate from the class side. And so, forward the selected language from my class to babel for other kind of label translation (like dates and ToC). – ygini Dec 14 '17 at 14:23

Your Answer

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

Browse other questions tagged or ask your own question.