How do I alter a message in the message queue independent of site language? I want to programatically alter a message in the message queue. The message I want to alter is set in the message queue by function comment_form_submit() in comment.module, i.e.:

if ($comment-&gt;status == COMMENT_NOT_PUBLISHED) {
  if (!user_access('administer comments')) {
    drupal_set_message(t('Your comment has been queued for review by site administrators and will be published after approval.'));
  }
}


Instead of this, I want the call to drupal_set_message() to be this:

drupal_set_message(t('Your comment will be published when you validate your e-mail address.'));


How do I do this?

Postscript: Based on the answer below by Topsitemakers, I got this working for any language by using array_search() inside a custom MYMODULE_comment_submit to search the message array, and then compare the translated strings to identify the key of the string to alter.

This is the working code I ended up with:

$mm = drupal_get_messages('status', TRUE);
$key = array_search(t('Your comment has been queued for review by site administrators and will be published after approval.'), $mm['status']);
if (FALSE !== $key) {
  $mm['status'][$key] = t('Your comment will be published when you validate your e-mail address.');
}
foreach ($mm['status'] as $msg) {
  drupal_set_message($msg, 'status');
}
You can compare messages using the t() function, as it will localize both messages and compare them.
Just use the original text in English you want to find and wrap it in t() function. E.g.:

if ($message == t('This is a sample message')) {
  // Alter the message/perform additional processing.
}