How do I hook into t()? Drupal uses t() in various places. I was wondering if there was a way to hook into this function. Basically, if Drupal calls:

t("some string");


I wanted to modify this string and add "BOOM" at the end. I was hoping it would be as easy as this

function mymodule_t($string)
{
   return $string.'BOOM';
}


But no luck... any ideas on how to get this right?
AFAIK Drupal's t() function does not provide any hooks for neither altering its input values nor its results.

However, if your intention is to override specific translations of the locale module, you can alter them within the translation interface of Drupal at '/admin/config/regional/translate/translate'.

If you don't want to alter the database stored locale translations, or don't have the locale module enabled, you can also provide according overrides within your settings.php by defining $conf['locale_custom_strings_' . TARGET_LANGUAGE][CONTEXT]. Replace TARGET_LANGUAGE with the target language shortcut, and CONTEXT with the context of the translation (usually an empty string):

$conf['locale_custom_strings_en'][''] = array(
  'some string' =&gt; 'some stringBOOM',
);