(I know this question is old, and maybe you've found a solution, but it's still lingering on the unanswered list.)
I want to write a class which loads
babel and other language aware
packages and pass to all of them the option
ngerman as default.
Your assumption here is that all language-aware packages use the same option list as
babel, which is unfortunately not the case. It may be that you have a specific list of language-aware packages that your class will load, where you can verify whether this is true, but this doesn't take into account any additional packages the user might want to load after they've loaded your class that may also require language support.
The other problem is, what happens if the user wants to use XeLaTeX? In this case, they'll more likely want
polyglossia, and here there's another problem. From the
polyglossia no longer supports loading language definition files as
It also doesn't accept
ngerman as a language name. It must instead be
german with the option
So even if you do find an easy way to add
ngerman to the class option list, given that it doesn't contain any other language names, you still won't achieve your desired effect if a user of your class wants
polyglossia instead of
What of other language-aware packages? I've come across at least one class where the language is set using a key=value option in the form
language=enGB. Given the increasing number of packages with a key=value option list, there may well be some packages that require the language set in this way as well. (I can't recall any off the top of my head, but I did consider it for one of my packages with a key=value option list, although in the end I decided it wasn't a good idea.)
I think that most packages that provide multilingual support tend to check for
polyglossia so that they can integrate with their caption mechanism (especially given the complications it can cause if they don't in multilingual documents). However, for those that don't, there's no guarantee at all that they will recognise
ngerman as an option.
Therefore, it seems that the only practical solution to your question is to just concentrate on getting
polyglossia to set German as the default language if no language has been supplied by the user in the document class, and then assume that any other packages the user wants to load that has multilingual support will have the sense to check for
polyglossia and pick up the language lists from them.
The simplest method that I can think of to do this is:
ngerman is only automatically added if the user hasn't specified any language options in the document class, so it's not added if they don't want it.