<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
p.line867, li.line867, div.line867
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
p.line862, li.line862, div.line862
        {mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";
        color:black;}
span.EmailStyle21
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>With some implementation help from chx, I proposed
a new hook at issue <a href="http://drupal.org/node/127262">http://drupal.org/node/127262</a>.
I am just bringing this up here to get quick focus and a double check of idea.
The actual code change is rather small, so I was hoping it could be reviewed
and accepted/rejected early on, before the flood of more major updates and
ideas comes as we approach the code freeze.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The basic justification for this new hook
is found in the issue, pasted here for quick reference.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>“As
I have been working on the functional implementation for a new community Drupal
site, I have been seeing the need to customize many of the core Drupal messages
(the drupal_set_message function), as required by the needs of the site. A
typical example would be when a contact message has been sent, the default
message is 'The message has been sent.' An small change might be to 'Thank you,
your message has been sent.' A more dynamic change would be 'Thank you Greg,
your message has been sent'.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>The first
change could be accomplished using the locale module methodologies found in <a
href="http://drupal.org/node/58030" title="http://drupal.org/node/58030">http://drupal.org/node/58030</a>.
But there are two short-comings to this method. First, even though all core
modules use t() for the text to make it translation ready, many contributed
modules do not. Second, the translation method only allows for string
replacements, not dynamic insertions. Granted some of the messages place the
user's name or other dynamic information into the message, but the basic idea
is that you can only change what is given you, you can't add to it. The contact
message is a perfect example, there is no way to add the user's name to the
message.<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>That is
why I am going to propose a new drupal hook, hook_message_alter(&$message =
NULL), allowing the $message to be changed by reference. It would hook into the
drupal_set_message function. All messages would invoke this hook, giving
designers and developers the ability to customize those messages completely to
suit their site.”<o:p></o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><o:p> </o:p></span></font></p>
<p><font size=3 face="Times New Roman"><span style='font-size:12.0pt'>-Greg<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
</div>
</body>
</html>