Update of /cvsroot/roller/roller/src/org/roller/presentation/weblog/actions
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10185/src/org/roller/presentation/weblog/actions
Modified Files:
CommentFormAction.java
Log Message:
i18n-ed comment email messages
Index: CommentFormAction.java
===================================================================
RCS file:
/cvsroot/roller/roller/src/org/roller/presentation/weblog/actions/CommentFormAction.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** CommentFormAction.java 23 May 2004 13:34:20 -0000 1.43
--- CommentFormAction.java 25 May 2004 04:53:43 -0000 1.44
***************
*** 10,13 ****
--- 10,14 ----
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DispatchAction;
+ import org.apache.struts.util.MessageResources;
import org.apache.struts.util.RequestUtils;
import org.roller.RollerException;
***************
*** 18,21 ****
--- 19,23 ----
import org.roller.pojos.UserData;
import org.roller.pojos.WeblogEntryData;
+ import org.roller.presentation.LanguageUtil;
import org.roller.presentation.RollerContext;
import org.roller.presentation.RollerRequest;
***************
*** 30,33 ****
--- 32,36 ----
import java.util.Iterator;
import java.util.List;
+ import java.util.Locale;
import javax.mail.MessagingException;
***************
*** 244,247 ****
--- 247,254 ----
RollerContext rc = RollerContext.getRollerContext( request );
RollerConfig rollerConfig = rc.getRollerConfig();
+
+ MessageResources resources = getResources(request);
+ Locale viewLocale = LanguageUtil.getViewLocale(request);
+
// Send e-mail to owner (if enabled) and subscribed users
if ( rollerConfig.getEmailComments().booleanValue() )
***************
*** 280,291 ****
}
! if (!StringUtils.isEmpty(cd.getName()))
! {
! msg.append(cd.getName() + " wrote:");
! }
! else
! {
! msg.append("An anonymous user wrote:");
! }
msg.append((escapeHtml) ? "\n\n" : "<br /><br />");
--- 287,298 ----
}
! if (!StringUtils.isEmpty(cd.getName()))
! {
! msg.append(cd.getName() + " " +
resources.getMessage(viewLocale, "email.comment.wrote") + ": ");
! }
! else
! {
! msg.append(resources.getMessage(viewLocale,
"email.comment.anonymous") + ": ");
! }
msg.append((escapeHtml) ? "\n\n" : "<br /><br />");
***************
*** 293,297 ****
msg.append((escapeHtml) ? "\n\n----\n" :
"<br /><br /><hr /><span style=\"font-size: 11px\">");
! msg.append("Respond to this comment at: ");
msg.append((escapeHtml) ? "\n" : "<br />");
--- 300,304 ----
msg.append((escapeHtml) ? "\n\n----\n" :
"<br /><br /><hr /><span style=\"font-size: 11px\">");
! msg.append(resources.getMessage(viewLocale,
"email.comment.respond") + ": ");
msg.append((escapeHtml) ? "\n" : "<br />");
***************
*** 325,337 ****
String subject = null;
! if ( (subscribers.size() > 1) ||
! (StringUtils.equals(cd.getEmail(),
user.getEmailAddress()) ))
! {
! subject = "RE: Comment: ";
! }
! else
! {
! subject = "Comment: ";
! }
subject += wd.getTitle();
--- 332,344 ----
String subject = null;
! if ( (subscribers.size() > 1) ||
! (StringUtils.equals(cd.getEmail(),
user.getEmailAddress()) ))
! {
! subject = "RE: " +
resources.getMessage(viewLocale, "email.comment.title") + ": ";
! }
! else
! {
! subject = resources.getMessage(viewLocale,
"email.comment.title") + ": ";
! }
subject += wd.getTitle();
***************
*** 424,427 ****
--- 431,437 ----
throws MalformedURLException, RollerException
{
+ MessageResources resources = getResources(request);
+ Locale viewLocale = LanguageUtil.getViewLocale(request);
+
String from = (StringUtils.isEmpty(cd.getEmail()))
? "email@xxxxxxxxxxxxxxxx" :
cd.getEmail();
***************
*** 460,468 ****
if (!StringUtils.isEmpty(cd.getName()))
{
! msg.append(cd.getName() + " wrote:");
}
else
{
! msg.append("An anonymous user wrote:");
}
--- 470,478 ----
if (!StringUtils.isEmpty(cd.getName()))
{
! msg.append(cd.getName() + " " +
resources.getMessage(viewLocale, "email.comment.wrote") + ": ");
}
else
{
! msg.append(resources.getMessage(viewLocale,
"email.comment.anonymous") + ": ");
}
***************
*** 471,475 ****
msg.append((escapeHtml) ? "\n\n----\n" :
"<br /><br /><hr /><span style=\"font-size: 11px\">");
! msg.append("Respond to this comment at: ");
msg.append((escapeHtml) ? "\n" : "<br />");
--- 481,485 ----
msg.append((escapeHtml) ? "\n\n----\n" :
"<br /><br /><hr /><span style=\"font-size: 11px\">");
! msg.append(resources.getMessage(viewLocale,
"email.comment.respond") + ": ");
msg.append((escapeHtml) ? "\n" : "<br />");
***************
*** 506,514 ****
(StringUtils.equals(cd.getEmail(),
user.getEmailAddress()) ))
{
! subject = "RE: Comment: ";
}
else
{
! subject = "Comment: ";
}
--- 516,524 ----
(StringUtils.equals(cd.getEmail(),
user.getEmailAddress()) ))
{
! subject = "RE: " + resources.getMessage(viewLocale,
"email.comment.title") + ": ";
}
else
{
! subject = resources.getMessage(viewLocale,
"email.comment.title") + ": ";
}
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
|