By default, the password change form on the user account page looks like this:

  • Current password
  • Password
  • Confirm password

This is bad usability because it is not clear to users that "Password" means "New password".

So I want to change the strings to this:

  • Current password
  • New password
  • Confirm new password

Under interface translation, it's easy to change "Confirm password" to "Confirm new password" because that string is only used for the confirm password form. However, I cannot change "Password" to "New password" using the translation interface because this is the same "Password" used on the user login form.

So, I tried to alter this in hook_form_alter() targeting the user account page, but $form['account']['pass'] does not contain the strings "Password" and "Confirm password":


How do I change the text "Password" only on the Password Confirmation widget?


Browse other questions tagged or ask your own question.