You've got some nasty bug in this code part.

Step 1:
de_DE
Step 2 (because of a QSetting):
de
Step 3 (still from the QSetting):
de

lang = de and after this line it is just empty, which leads to the default language getting activated!