1

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…

EDIT 1

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.

TeXnician
  • 33,589
ygini
  • 11
  • 2
  • 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 08:57
  • Imho your question is to vage and too broad. Regarding setting french as default see https://tex.stackexchange.com/questions/147243/a-class-with-default-language-settings – Ulrike Fischer Dec 12 '17 at 10:11
  • 1
  • 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
  • All comments and suggested packages are valid for classes. In your class you define the translatable (?) word/command and the required package (already loaded by your class) will use the corresponding word/expression translated to the language used in the document. Please, read a little bit babel, translator or translations documentation and will understand the mechanism. – Ignasi Dec 14 '17 at 16:33
  • @Ignasi I've already looked at the doc as said in my original post and I didn't be able to find any viable solution. – ygini Dec 15 '17 at 21:16
  • That's basically why I'm asking for help and hopefully sample code who work for real.

    During my tests, I've never been able to overload the selected language in the class for babel during initial load.

    And when loading babel with multiple languages support, I've never been able to select which one should be active, and so, all my tests for current language was always true, leading all version of a label being displayed in the same time.

    – ygini Dec 15 '17 at 21:18
  • I really hope someone here could be kind enough to provide a sample code. Looking at my demo class provided in the original post, you can see I can fairly use LaTeX, so if I'm asking for help here, it's because reading documentation didn't solved my issue! – ygini Dec 15 '17 at 21:19

0 Answers0