For a custom module, I need to change the language of the registration form based on the subdomain the user is currently active on.
I tried changing the global $language variable in hook_form_user_register_form_alter, but that does not work ($language variable is also not set at that point). I also tried setting the language in the $user object, but also no dice (probably because it is an anonymous user).
Finally I took a look at the language negotiation api, but setting up negotiation providers seems overkill for this (and haven't it studied enough to get a grasp on how to use it).
I just need to render the registration page in a different (but already available) language on /user/register, based on the subdomain. What would be the best way to achieve this.
I'm using Drupal 7.