Change Password/Confirm_Password Password Tips How does one go about changing the Password Tips for the password_confirm form element?

This one specifically:

Recommendations to make your password stronger: 
•Make it at least 12 characters 
•Add lowercase letters
•Add uppercase letters 
•Add numbers 
•Add punctuation


Into something like:

Password should have: 
• Minimum of 12 characters 
• At least one lowercase letter
• At least one uppercase letter
• At least one number
• At least one special character
• No three consecutive same characters


I'm tried using the hook_element_info_alter() hook that calls a method my_module_form_process_password_confirm() and followed this template(https://api.drupal.org/api/drupal/core%21modules%21user%21user.module/function/user_form_process_password_confirm/8.5.x).

But it doesn't seem to be working.

/**
 * Implements hook_element_info_alter().
 */
function client_element_info_alter(array &amp;$types) {
  if (isset($types['password_confirm'])) {
    $types['password_confirm']['#process'][] = 'client_form_process_password_confirm';
  }
}

function client_form_process_password_confirm($element){
  if (($key = array_search('user_form_process_password_confirm', $element['#process'])) !== false) {
    unset($element['#process'][$key]);
  }
  $element['#process'] = array_values($element['#process']);

  $password_settings = [
    'confirmTitle' =&gt; t('Passwords match DOES IT:'),
    'confirmSuccess' =&gt; t('yes'),
    'confirmFailure' =&gt; t('no'),
    'showStrengthIndicator' =&gt; FALSE,
  ];

  $password_settings['showStrengthIndicator'] = TRUE;
  $password_settings += [
    'strengthTitle' =&gt; t('Password strength:'),
    'hasWeaknesses' =&gt; t('Password should have:'),
    'tooShort' =&gt; t('Minimum of 12 characters'),
    'addLowerCase' =&gt; t('At least one lowercase letter'),
    'addUpperCase' =&gt; t('At least one uppercase letter'),
    'addNumbers' =&gt; t('At least one number'),
    'addPunctuation' =&gt; t('At least one special character'),
    'sameAsUsername' =&gt; t('Make it different from your username'),
    'weak' =&gt; t('Weak'),
    'fair' =&gt; t('Fair'),
    'good' =&gt; t('Good'),
    'strong' =&gt; t('Strong'),
    'username' =&gt; \Drupal::currentUser()-&gt;getUsername(),
  ];

  $element['#attached']['library'][] = 'user/drupal.user';
  $element['#attached']['drupalSettings']['password'] = $password_settings;

  return $element;
}
so I managed to tinker enough to get something to work and I'm sharing it in case other people need it or something. Of course, I dunno if this is optimal or follows standards or shouldn't even be done in the first place but please feel free to add your input. It's in the my_module.module file, by the by. Oh and don't mind the text, was just kinda testing this out and all that jazz.

Without further ado, here's the code:

/**
 * Implements hook_form_alter().
 */
function &lt;my_module&gt;_form_alter(&amp;$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
  if ($form_id === &lt;my_custom_form_id&gt;) {
    // Note that this isn't actually a hook
    $form['#after_build'][] = '&lt;my_module&gt;_confirm_password_after_build';
  }
}

function client_confirm_password_after_build($element) {
  $drupal_settings = $element['pass']['#attached']['drupalSettings']['password'];

  $drupal_settings = [
    'confirmTitle'          =&gt; t('Do the passwords match?'),
    'confirmSuccess'        =&gt; t('Yeah'),
    'confirmFailure'        =&gt; t('Nope'),
    'showStrengthIndicator' =&gt; TRUE,
    'hasWeaknesses'         =&gt; t('Password Suggestions:'),
    'tooShort'              =&gt; t('Make it at least 50 characters'),
    'addLowerCase'          =&gt; t('Add 7 lowercase letters'),
    'addUpperCase'          =&gt; t('Add 8 uppercase letters'),
    'addNumbers'            =&gt; t('Add 8 numbers'),
    'addPunctuation'        =&gt; t('Add 10 punctuations'),
    'sameAsUsername'        =&gt; t(''),
    'weak' =&gt; t('Forgettable'),
    'fair' =&gt; t('Meh'),
    'good' =&gt; t('Almost'),
    'strong' =&gt; t('You got it'),
    'username' =&gt; '',
  ];

  $element['pass']['#attached']['drupalSettings']['password'] = $drupal_settings;
  return $element;
}