novoid / LaTeX-KOMA-template

Generic template for midsize and larger documents based on KOMA script classes.
Other
200 stars 65 forks source link

Create/Modify Language Switch #32

Closed didi1357 closed 2 years ago

didi1357 commented 3 years ago

Hi,

I think instead of using the babel argument as language switch it would be cleaner to have "en"/"de" for the user to choose in main.tex as some kind of global language switch.

From a user perspective I usually want to change the language of the titlepage, the affidavit and all used packages at once.

Sure we could most likely just ifthen for the term ngerman,american, but this doesn't feel clean to me. I also didn't test if the comma would break the equality test of ifthen.

If you like this suggestion I could create a pull request.

novoid commented 3 years ago

Did I understand you correctly? Although there is currently only one language switch (for babel), you suggest to introduce a general language proxy variable which then gets translated to the babel syntax?

The issue I would presume is that people who do not use English/German would need to understand and adapt multiple settings in order to introduce their language.

What's your opinion on this?

didi1357 commented 3 years ago

Did I understand you correctly? Although there is currently only one language switch (for babel), you suggest to introduce a general language proxy variable which then gets translated to the babel syntax?

Yes, because the babel setting is not just the only place where the information from this switch is relevant. You already got a second switch for the english affidavit which could also be replaced by this global one.

The issue I would presume is that people who do not use English/German would need to understand and adapt multiple settings in order to introduce their language.

If I got your concern correctly you're worried that people who are using another language (completely different from english or german) need to adapt the template at many places. My opinion is, that people who are not using english or german need to adapt at many places in every case. They need to acquire the necessary skills anyways. Just think about the output encoding issue we are also talking about in my other pull request currently. Other languages are often coming with additional characters...

However, from the forks and stars I suspect that most of your users are from TU Graz or at least another german speaking university or "AHS/BHS". So most of them will just need to write in english or (maybe in some rare cases "and") german. Having a switch which allows to set the language at one central place without knowing all the background would definitely lower a beginners trouble who is interested in writing his thesis/VWA/etc. with Latex and your template.

Also to recap: This is not just about renaming or reworking the babel switch. This is in my opinion also relevant/usable for at least the affidavit and the titlepage.

novoid commented 2 years ago

I do see an issue here and this is why I'm going to close this issue for now: I'd have to implement a mapping functionality between the global language setting (say "German" or "US English") and all(?) possible other variants of them.

For German, I can think of:

Language switch variables are far from unified within one language. Therefore, I don't see the benefit for now although I understand the reasoning for your improvement suggestion.

didi1357 commented 2 years ago

I see.. Still.. I don't think the mapping approach is completely unfeasible. Reason: Not all packages need or allow this level of language detail. But you're right, preconfiguring this detail level completely is probably paternalism.

Maybe we could base on the babel package's language name? It seems to be the most specific/detailed one to me and many packages already pull their language information from there if available.

E.g. A configuration block for the user could look like:

\newcommand{\mylanguage}{ngerman}
%% Currently implemented options: "naustrian" or "ngerman" or "USenglish" or "UKenglish"
%% This setting configures multiple packages with the correct language variant.

In the background \mylanguage is supplied to babel and for the simpler packages, we could create a mapping to another unspecific language variable:

\ifthenelse{\equal{\mylanguage}{USenglish} or ...}
{
\newcommand{\mylangunspecific}{en}
}
{
\ifthenelse{\equal{\mylanguage}{ngerman} or ...}
  {
    \newcommand{\mylangunspecific}{de}
  }
  {
    abort(Other languages not implemented in template yet)
  }
}