Change user language from app controller

I’ve developed an nextcloud app and now I need to change the user language from my apps controller. I don’t find any documentation or hints in the source code.

I took already a look into the User, Account, AccountManager classes and their interfaces. But couldn’t find any function.

How could I solve this?

It seems the user’s language is stored in UserConfig → ‘core’ → ‘lang’

see server/Factory.php at a6f0278e67287612357ed99ec423f36893871019 · nextcloud/server · GitHub