I'm currently working on creating a generic invoice in LaTeX. Later I don't want to change the document, but a little section which only contains variables. It works fine for now, but now I want to introduce a variable which switches the language between english and ngerman. Because \selectlanguage of the babel package just works in the document section, I have to define a variable for that.
I tried it with
And then in the document section with
Neither of these worked, because of the error "You haven't defined documentLanguage yet". I think the \ somehow gets removed and the parser just reads "documentLanguage" as string.
Is there a way to fix this behavior?