Yii::t (Multilanguage) In Console

Hey all, I have created a console command that creates a file and uses Yii::t() to translate some texts. However, even if I set the language to something else that english with Yii::app->setLanguage(), and check that it is really changed with Yii::app->getLanguage() the texts are always in english.

When I run this same command from web, the texts are correctly translated.

How can I get translations to work with console?