Is is quite likely that the German locale is not installed on the server your running the script on – do you have shell access to the server?
Then try
locale -a
to see which locales are installed. Also have a look here Is it feasible to rely on setlocale, and rely on locales being installed?