function locale_form_alter

Implements hook_form_alter().

Adds language fields to user forms.

File

modules/locale/locale.module, line 352

Code

function locale_form_alter(&$form, &$form_state, $form_id) {
    // Only alter user forms if there is more than one language.
    if (drupal_multilingual()) {
        // Display language selector when either creating a user on the admin
        // interface or editing a user account.
        if ($form_id == 'user_register_form' || $form_id == 'user_profile_form' && $form['#user_category'] == 'account') {
            locale_language_selector_form($form, $form_state, $form['#user']);
        }
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.