forked from I2P_Developers/i2p.i2p
I18N for susimail, including dutch translation.
This commit is contained in:
34
apps/susimail/src/src/i2p/susi/webmail/Messages.java
Normal file
34
apps/susimail/src/src/i2p/susi/webmail/Messages.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package i2p.susi.webmail;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.util.Translate;
|
||||
|
||||
/**
|
||||
* Translate strings for this package.
|
||||
* @since 0.8.5
|
||||
*/
|
||||
public class Messages {
|
||||
private static final String BUNDLE_NAME = "i2p.susi.webmail.messages";
|
||||
private final I2PAppContext _context;
|
||||
|
||||
public Messages() {
|
||||
_context = I2PAppContext.getGlobalContext();
|
||||
}
|
||||
|
||||
/** lang in routerconsole.lang property, else current locale */
|
||||
public String _(String key) {
|
||||
return Translate.getString(key, _context, BUNDLE_NAME);
|
||||
}
|
||||
|
||||
public static String getString(String s) {
|
||||
return Translate.getString(s, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
|
||||
}
|
||||
|
||||
public static String getString(String s, Object o) {
|
||||
return Translate.getString(s, o, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
|
||||
}
|
||||
|
||||
public static String getString(String s, Object o, Object o2) {
|
||||
return Translate.getString(s, o, o2, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
|
||||
}
|
||||
}
|
||||
@@ -27,6 +27,7 @@ import i2p.susi.debug.Debug;
|
||||
import i2p.susi.util.Config;
|
||||
import i2p.susi.util.Folder;
|
||||
import i2p.susi.util.ReadBuffer;
|
||||
import i2p.susi.webmail.Messages;
|
||||
import i2p.susi.webmail.encoding.DecodingException;
|
||||
import i2p.susi.webmail.encoding.Encoding;
|
||||
import i2p.susi.webmail.encoding.EncodingException;
|
||||
@@ -450,7 +451,7 @@ public class WebMail extends HttpServlet
|
||||
( mailPart.description != null ? mailPart.description + ", " : "" ) +
|
||||
( mailPart.filename != null ? mailPart.filename + ", " : "" ) +
|
||||
( mailPart.name != null ? mailPart.name + ", " : "" ) +
|
||||
( mailPart.type != null ? mailPart.type : "unknown" ) );
|
||||
( mailPart.type != null ? mailPart.type : _("unknown") ) );
|
||||
|
||||
if( level == 0 && mailPart.version == null ) {
|
||||
/*
|
||||
@@ -469,18 +470,18 @@ public class WebMail extends HttpServlet
|
||||
String encoding = mailPart.encoding;
|
||||
if( encoding == null ) {
|
||||
encoding = "7bit";
|
||||
reason += "Warning: no transfer encoding found, fallback to 7bit." + br;
|
||||
reason += _("Warning: no transfer encoding found, fallback to 7bit.") + br;
|
||||
}
|
||||
Encoding e = EncodingFactory.getEncoding( encoding );
|
||||
if( e == null ) {
|
||||
showBody = false;
|
||||
reason += "No encoder found for encoding '" + quoteHTML( encoding ) + "'.";
|
||||
reason += _("No encoder found for encoding \\''{0}\\''.", quoteHTML( encoding ));
|
||||
}
|
||||
else {
|
||||
String charset = mailPart.charset;
|
||||
if( charset == null ) {
|
||||
charset = "US-ASCII";
|
||||
reason += "Warning: no charset found, fallback to US-ASCII." + br;
|
||||
reason += _("Warning: no charset found, fallback to US-ASCII.") + br;
|
||||
}
|
||||
try {
|
||||
ReadBuffer decoded = e.decode( mailPart.buffer.content, mailPart.beginBody, mailPart.end - mailPart.beginBody );
|
||||
@@ -494,11 +495,11 @@ public class WebMail extends HttpServlet
|
||||
}
|
||||
catch( UnsupportedEncodingException uee ) {
|
||||
showBody = false;
|
||||
reason = "Charset '" + quoteHTML( mailPart.charset ) + "' not supported." + br;
|
||||
reason = _("Charset \\''{0}\\'' not supported.", quoteHTML( mailPart.charset )) + br;
|
||||
}
|
||||
catch (Exception e1) {
|
||||
showBody = false;
|
||||
reason += "Part (" + ident + ") not shown, because of " + e1.getClass().getName() + br;
|
||||
reason += _("Part ({0}) not shown, because of {1}", ident, e1.getClass().getName()) + br;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -521,11 +522,11 @@ public class WebMail extends HttpServlet
|
||||
if( prepareAttachment ) {
|
||||
if( html ) {
|
||||
out.println( "<p class=\"mailbody\">" );
|
||||
out.println( "<a target=\"_blank\" href=\"" + myself + "?" + DOWNLOAD + "=" + mailPart.hashCode() + "\">Download</a> attachment (" + ident + "). File is packed into a zipfile for security reasons." );
|
||||
out.println( "<a target=\"_blank\" href=\"" + myself + "?" + DOWNLOAD + "=" + mailPart.hashCode() + "\">" + _("Download") + "</a> " + _("attachment ({0}).", ident) + " " + _("File is packed into a zipfile for security reasons.") );
|
||||
out.println( "</p>" );
|
||||
}
|
||||
else {
|
||||
out.println( "Attachment (" + ident + ")." );
|
||||
out.println( _("Attachment ({0}).", ident) );
|
||||
}
|
||||
}
|
||||
if( html )
|
||||
@@ -575,52 +576,52 @@ public class WebMail extends HttpServlet
|
||||
if( buttonPressed( request, LOGIN ) ) {
|
||||
|
||||
if( user == null || user.length() == 0 ) {
|
||||
sessionObject.error += "Need username for authentication.<br>";
|
||||
sessionObject.error += _("Need username for authentication.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
if( pass == null || pass.length() == 0 ) {
|
||||
sessionObject.error += "Need password for authentication.<br>";
|
||||
sessionObject.error += _("Need password for authentication.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
if( host == null || host.length() == 0 ) {
|
||||
sessionObject.error += "Need hostname for connect.<br>";
|
||||
sessionObject.error += _("Need hostname for connect.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
int pop3PortNo = 0;
|
||||
if( pop3Port == null || pop3Port.length() == 0 ) {
|
||||
sessionObject.error += "Need port number for pop3 connect.<br>";
|
||||
sessionObject.error += _("Need port number for pop3 connect.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
else {
|
||||
try {
|
||||
pop3PortNo = Integer.parseInt( pop3Port );
|
||||
if( pop3PortNo < 0 || pop3PortNo > 65535 ) {
|
||||
sessionObject.error += "POP3 port number is not in range 0..65535.<br>";
|
||||
sessionObject.error += _("POP3 port number is not in range 0..65535.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
}
|
||||
catch( NumberFormatException nfe )
|
||||
{
|
||||
sessionObject.error += "POP3 port number is invalid.<br>";
|
||||
sessionObject.error += _("POP3 port number is invalid.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
}
|
||||
int smtpPortNo = 0;
|
||||
if( smtpPort == null || smtpPort.length() == 0 ) {
|
||||
sessionObject.error += "Need port number for smtp connect.<br>";
|
||||
sessionObject.error += _("Need port number for smtp connect.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
else {
|
||||
try {
|
||||
smtpPortNo = Integer.parseInt( smtpPort );
|
||||
if( smtpPortNo < 0 || smtpPortNo > 65535 ) {
|
||||
sessionObject.error += "SMTP port number is not in range 0..65535.<br>";
|
||||
sessionObject.error += _("SMTP port number is not in range 0..65535.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
}
|
||||
catch( NumberFormatException nfe )
|
||||
{
|
||||
sessionObject.error += "SMTP port number is invalid.<br>";
|
||||
sessionObject.error += _("SMTP port number is invalid.") + "<br>";
|
||||
doContinue = false;
|
||||
}
|
||||
}
|
||||
@@ -667,11 +668,11 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.mailbox.close();
|
||||
sessionObject.mailbox = null;
|
||||
}
|
||||
sessionObject.info += "User logged out.<br>";
|
||||
sessionObject.info += _("User logged out.") + "<br>";
|
||||
sessionObject.state = STATE_AUTH;
|
||||
}
|
||||
else if( sessionObject.mailbox == null ) {
|
||||
sessionObject.error += "Internal error, lost connection.<br>";
|
||||
sessionObject.error += _("Internal error, lost connection.") + "<br>";
|
||||
sessionObject.state = STATE_AUTH;
|
||||
}
|
||||
}
|
||||
@@ -767,7 +768,7 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.subject = "Re: " + mail.formattedSubject;
|
||||
StringWriter text = new StringWriter();
|
||||
PrintWriter pw = new PrintWriter( text );
|
||||
pw.println( "On " + mail.formattedDate + " " + sessionObject.replyTo + " wrote:" );
|
||||
pw.println( _("On {0} {1} wrote:", mail.formattedDate, sessionObject.replyTo) );
|
||||
StringWriter text2 = new StringWriter();
|
||||
PrintWriter pw2 = new PrintWriter( text2 );
|
||||
showPart( pw2, mail.part, 0, TEXT_ONLY );
|
||||
@@ -814,7 +815,7 @@ public class WebMail extends HttpServlet
|
||||
pw.println();
|
||||
pw.println();
|
||||
pw.println();
|
||||
pw.println( "---- begin forwarded mail ----" );
|
||||
pw.println( "---- " + _("begin forwarded mail") + " ----" );
|
||||
pw.println( "From: " + sender );
|
||||
if( mail.to != null ) {
|
||||
String pad = "To: ";
|
||||
@@ -836,14 +837,14 @@ public class WebMail extends HttpServlet
|
||||
pw.print( "Date: " + mail.dateString );
|
||||
pw.println();
|
||||
showPart( pw, mail.part, 0, TEXT_ONLY );
|
||||
pw.println( "---- end forwarded mail ----" );
|
||||
pw.println( "---- " + _("end forwarded mail") + " ----" );
|
||||
pw.flush();
|
||||
sessionObject.body = text.toString();
|
||||
}
|
||||
sessionObject.state = STATE_NEW;
|
||||
}
|
||||
else {
|
||||
sessionObject.error += "Could not fetch mail body.<br>";
|
||||
sessionObject.error += _("Could not fetch mail body.") + "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -871,7 +872,7 @@ public class WebMail extends HttpServlet
|
||||
}
|
||||
catch( NumberFormatException nfe )
|
||||
{
|
||||
sessionObject.error += "Message id not valid.<br>";
|
||||
sessionObject.error += _("Message id not valid.") + "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -954,16 +955,16 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.attachments.add( attachment );
|
||||
}
|
||||
else {
|
||||
sessionObject.error += "No Encoding found for " + encodeTo + "<br>";
|
||||
sessionObject.error += _("No Encoding found for {0}", encodeTo) + "<br>";
|
||||
}
|
||||
}
|
||||
catch (EncodingException e1) {
|
||||
sessionObject.error += "Could not encode data: " + e1.getMessage();
|
||||
sessionObject.error += _("Could not encode data: {0}", e1.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
sessionObject.error += "Error reading uploaded file: " + e.getMessage() + "<br>";
|
||||
sessionObject.error += _("Error reading uploaded file: {0}", e.getMessage()) + "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1041,7 +1042,7 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.showAttachment = part;
|
||||
}
|
||||
catch( NumberFormatException nfe ) {
|
||||
sessionObject.error += "Error parsing download parameter.";
|
||||
sessionObject.error += _("Error parsing download parameter.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1085,7 +1086,7 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.folder.setPageSize( pageSize );
|
||||
}
|
||||
catch( NumberFormatException nfe ) {
|
||||
sessionObject.error += "Invalid pagesize number, resetting to default value.<br>";
|
||||
sessionObject.error += _("Invalid pagesize number, resetting to default value.") + "<br>";
|
||||
}
|
||||
}
|
||||
if( buttonPressed( request, PREVPAGE ) ) {
|
||||
@@ -1109,7 +1110,7 @@ public class WebMail extends HttpServlet
|
||||
if( m != -1 )
|
||||
sessionObject.reallyDelete = true;
|
||||
else
|
||||
sessionObject.error += "No messages marked for deletion.<br>";
|
||||
sessionObject.error += _("No messages marked for deletion.") + "<br>";
|
||||
}
|
||||
else {
|
||||
int numberDeleted = 0;
|
||||
@@ -1129,7 +1130,7 @@ public class WebMail extends HttpServlet
|
||||
numberDeleted++;
|
||||
}
|
||||
else
|
||||
sessionObject.error += "Error deleting message: " + sessionObject.mailbox.lastError() + "<br>";
|
||||
sessionObject.error += _("Error deleting message: {0}", sessionObject.mailbox.lastError()) + "<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1140,7 +1141,7 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.mailbox.performDelete();
|
||||
sessionObject.folder.setElements( sessionObject.mailbox.getUIDLs() );
|
||||
sessionObject.pageChanged = true;
|
||||
sessionObject.info += numberDeleted + " messages deleted.";
|
||||
sessionObject.info += _("{0} messages deleted.", numberDeleted);
|
||||
}
|
||||
sessionObject.reallyDelete = false;
|
||||
}
|
||||
@@ -1260,11 +1261,11 @@ public class WebMail extends HttpServlet
|
||||
* build subtitle
|
||||
*/
|
||||
if( sessionObject.state == STATE_AUTH )
|
||||
subtitle = "Login";
|
||||
subtitle = _("Login");
|
||||
else if( sessionObject.state == STATE_LIST )
|
||||
subtitle = "" + sessionObject.mailbox.getNumMails() + " Messages";
|
||||
subtitle = _("{0} Messages", sessionObject.mailbox.getNumMails());
|
||||
else if( sessionObject.state == STATE_SHOW )
|
||||
subtitle = "Show Message";
|
||||
subtitle = _("Show Message");
|
||||
|
||||
response.setContentType( "text/html" );
|
||||
out.println( "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>" );
|
||||
@@ -1321,12 +1322,12 @@ public class WebMail extends HttpServlet
|
||||
content = encoding.decode( part.buffer.content, part.beginBody + 2, part.end - part.beginBody - 2 );
|
||||
}
|
||||
catch (DecodingException e) {
|
||||
sessionObject.error += "Error decoding content: " + e.getMessage() + "<br>";
|
||||
sessionObject.error += _("Error decoding content: {0}", e.getMessage()) + "<br>";
|
||||
content = null;
|
||||
}
|
||||
}
|
||||
else {
|
||||
sessionObject.error += "Error decoding content: No encoder found.";
|
||||
sessionObject.error += _("Error decoding content: No encoder found.");
|
||||
content = null;
|
||||
}
|
||||
}
|
||||
@@ -1373,7 +1374,7 @@ public class WebMail extends HttpServlet
|
||||
String to = request.getParameter( NEW_TO );
|
||||
String cc = request.getParameter( NEW_CC );
|
||||
String bcc = request.getParameter( NEW_BCC );
|
||||
String subject = request.getParameter( NEW_SUBJECT, "no subject" );
|
||||
String subject = request.getParameter( NEW_SUBJECT, _("no subject") );
|
||||
String text = request.getParameter( NEW_TEXT, "" );
|
||||
|
||||
String prop = Config.getProperty( CONFIG_SENDER_FIXED, "true" );
|
||||
@@ -1390,13 +1391,13 @@ public class WebMail extends HttpServlet
|
||||
|
||||
if( from == null || !Mail.validateAddress( from ) ) {
|
||||
ok = false;
|
||||
sessionObject.error += "Found no valid sender address.<br>";
|
||||
sessionObject.error += _("Found no valid sender address.") + "<br>";
|
||||
}
|
||||
else {
|
||||
sender = Mail.getAddress( from );
|
||||
if( sender == null || sender.length() == 0 ) {
|
||||
ok = false;
|
||||
sessionObject.error += "Found no valid address in '" + quoteHTML( from ) + "'.<br>";
|
||||
sessionObject.error += _("Found no valid address in \\''{0}\\''.", quoteHTML( from )) + "<br>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1415,19 +1416,19 @@ public class WebMail extends HttpServlet
|
||||
|
||||
if( recipients.isEmpty() ) {
|
||||
ok = false;
|
||||
sessionObject.error += "No recipients found.<br>";
|
||||
sessionObject.error += _("No recipients found.") + "<br>";
|
||||
}
|
||||
Encoding qp = EncodingFactory.getEncoding( "quoted-printable" );
|
||||
Encoding hl = EncodingFactory.getEncoding( "HEADERLINE" );
|
||||
|
||||
if( qp == null ) {
|
||||
ok = false;
|
||||
sessionObject.error += "Quoted printable encoder not available.";
|
||||
sessionObject.error += _("Quoted printable encoder not available.");
|
||||
}
|
||||
|
||||
if( hl == null ) {
|
||||
ok = false;
|
||||
sessionObject.error += "Header line encoder not available.";
|
||||
sessionObject.error += _("Header line encoder not available.");
|
||||
}
|
||||
|
||||
if( ok ) {
|
||||
@@ -1478,7 +1479,7 @@ public class WebMail extends HttpServlet
|
||||
sessionObject.user, sessionObject.pass,
|
||||
sender, recipients.toArray(), body.toString() ) ) {
|
||||
|
||||
sessionObject.info += "Mail sent.";
|
||||
sessionObject.info += _("Mail sent.");
|
||||
|
||||
if( sessionObject.attachments != null )
|
||||
sessionObject.attachments.clear();
|
||||
@@ -1515,11 +1516,11 @@ public class WebMail extends HttpServlet
|
||||
*/
|
||||
private void showCompose( PrintWriter out, SessionObject sessionObject, RequestWrapper request )
|
||||
{
|
||||
out.println( button( SEND, "Send" ) +
|
||||
button( CANCEL, "Cancel" ) + spacer +
|
||||
(sessionObject.attachments != null && (!sessionObject.attachments.isEmpty()) ? button( DELETE_ATTACHMENT, "Delete Attachment" ) : button2( DELETE_ATTACHMENT, "Delete Attachment" ) ) + spacer +
|
||||
button( RELOAD, "Reload Config" ) + spacer +
|
||||
button( LOGOUT, "Logout" ) );
|
||||
out.println( button( SEND, _("Send") ) +
|
||||
button( CANCEL, _("Cancel") ) + spacer +
|
||||
(sessionObject.attachments != null && (!sessionObject.attachments.isEmpty()) ? button( DELETE_ATTACHMENT, _("Delete Attachment") ) : button2( DELETE_ATTACHMENT, _("Delete Attachment") ) ) + spacer +
|
||||
button( RELOAD, _("Reload Config") ) + spacer +
|
||||
button( LOGOUT, _("Logout") ) );
|
||||
|
||||
String from = (String)request.getParameter( NEW_FROM );
|
||||
String fixed = Config.getProperty( CONFIG_SENDER_FIXED, "true" );
|
||||
@@ -1542,21 +1543,21 @@ public class WebMail extends HttpServlet
|
||||
|
||||
out.println( "<table cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
|
||||
"<tr><td align=\"right\">From:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_FROM + "\" value=\"" + from + "\" " + ( fixed.compareToIgnoreCase( "false" ) != 0 ? "disabled" : "" ) +"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">To:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_TO + "\" value=\"" + to + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">Cc:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_CC + "\" value=\"" + cc + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">Bcc:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_BCC + "\" value=\"" + bcc + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">Subject:</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_SUBJECT + "\" value=\"" + subject + "\"></td></tr>\n" +
|
||||
"<tr><td> </td><td align=\"left\"><input type=\"checkbox\" class=\"optbox\" name=\"" + NEW_BCC_TO_SELF + "\" value=\"1\"" + ( bccToSelf.compareToIgnoreCase( "false" ) != 0 ? "checked" : "" )+ ">Bcc to self</td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _("From:") + "</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_FROM + "\" value=\"" + from + "\" " + ( fixed.compareToIgnoreCase( "false" ) != 0 ? "disabled" : "" ) +"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _("To:") + "</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_TO + "\" value=\"" + to + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _("Cc:") + "</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_CC + "\" value=\"" + cc + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _("Bcc:") + "</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_BCC + "\" value=\"" + bcc + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\">" + _("Subject:") + "</td><td align=\"left\"><input type=\"text\" size=\"80\" name=\"" + NEW_SUBJECT + "\" value=\"" + subject + "\"></td></tr>\n" +
|
||||
"<tr><td> </td><td align=\"left\"><input type=\"checkbox\" class=\"optbox\" name=\"" + NEW_BCC_TO_SELF + "\" value=\"1\"" + ( bccToSelf.compareToIgnoreCase( "false" ) != 0 ? "checked" : "" )+ ">" + _("Bcc to self") + "</td></tr>\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><textarea cols=\"" + Config.getProperty( CONFIG_COMPOSER_COLS, 80 )+ "\" rows=\"" + Config.getProperty( CONFIG_COMPOSER_ROWS, 10 )+ "\" name=\"" + NEW_TEXT + "\">" + text + "</textarea>" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
|
||||
"<tr><td align=\"right\">New Attachment:</td><td align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\"><input type=\"submit\" name=\"" + NEW_UPLOAD + "\" value=\"Upload File\"></td></tr>" );
|
||||
"<tr><td align=\"right\">" + _("New Attachment:") + "</td><td align=\"left\"><input type=\"file\" size=\"50%\" name=\"" + NEW_FILENAME + "\" value=\"\"><input type=\"submit\" name=\"" + NEW_UPLOAD + "\" value=\"" + _("Upload File") + "\"></td></tr>" );
|
||||
|
||||
if( sessionObject.attachments != null && !sessionObject.attachments.isEmpty() ) {
|
||||
boolean wroteHeader = false;
|
||||
for( Iterator it = sessionObject.attachments.iterator(); it.hasNext(); ) {
|
||||
if( !wroteHeader ) {
|
||||
out.println( "<tr><td colspan=\"2\" align=\"center\">Attachments:</td></tr>" );
|
||||
out.println( "<tr><td colspan=\"2\" align=\"center\">" + _("Attachments:") + "</td></tr>" );
|
||||
wroteHeader = true;
|
||||
}
|
||||
Attachment attachment = (Attachment)it.next();
|
||||
@@ -1578,12 +1579,12 @@ public class WebMail extends HttpServlet
|
||||
String smtp = Config.getProperty( CONFIG_PORTS_SMTP, "" + DEFAULT_SMTPPORT );
|
||||
|
||||
out.println( "<table cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">User</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + USER + "\" value=\"" + ( RELEASE ? "" : "test") + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">Pass</td><td width=\"40%\" align=\"left\"><input type=\"password\" size=\"32\" name=\"pass\" value=\"" + ( RELEASE ? "" : "test") + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">Host</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + HOST +"\" value=\"" + host + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">POP3-Port</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + POP3 +"\" value=\"" + pop3 + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">SMTP-Port</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + SMTP +"\" value=\"" + smtp + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n" +
|
||||
"<tr><td align=\"center\" colspan=\"2\"><a href=\"http://hq.postman.i2p/?page_id=16\">Create Account</a> " + button( LOGIN, "Login" ) + " <input type=\"reset\" value=\"Reset\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">" + _("User") + "</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + USER + "\" value=\"" + ( RELEASE ? "" : "test") + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">" + _("Pass") + "</td><td width=\"40%\" align=\"left\"><input type=\"password\" size=\"32\" name=\"pass\" value=\"" + ( RELEASE ? "" : "test") + "\"></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">" + _("Host") + "</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + HOST +"\" value=\"" + host + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">" + _("POP3-Port") + "</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + POP3 +"\" value=\"" + pop3 + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n" +
|
||||
"<tr><td align=\"right\" width=\"30%\">" + _("SMTP-Port") + "</td><td width=\"40%\" align=\"left\"><input type=\"text\" size=\"32\" name=\"" + SMTP +"\" value=\"" + smtp + "\"" + ( fixed ? " disabled" : "" ) + "></td></tr>\n" +
|
||||
"<tr><td align=\"center\" colspan=\"2\"><a href=\"http://hq.postman.i2p/?page_id=16\">" + _("Create Account") + "</a> " + button( LOGIN, _("Login") ) + " <input type=\"reset\" value=\"" + _("Reset") + "\"></td></tr>\n" +
|
||||
"</table>");
|
||||
}
|
||||
/**
|
||||
@@ -1595,21 +1596,21 @@ public class WebMail extends HttpServlet
|
||||
private void showFolder( PrintWriter out, SessionObject sessionObject, RequestWrapper request )
|
||||
{
|
||||
if( sessionObject.reallyDelete ) {
|
||||
out.println( "<p class=\"error\">Really delete the marked messages? " + button( REALLYDELETE, "Yes, really delete them!" ) + "</p>" );
|
||||
out.println( "<p class=\"error\">" + _("Really delete the marked messages?") + " " + button( REALLYDELETE, _("Yes, really delete them!") ) + "</p>" );
|
||||
}
|
||||
out.println( button( NEW, "New" ) + spacer +
|
||||
button( REPLY, "Reply" ) +
|
||||
button( REPLYALL, "Reply All" ) +
|
||||
button( FORWARD, "Forward" ) + spacer +
|
||||
button( DELETE, "Delete" ) + spacer +
|
||||
button( REFRESH, "Check Mail" ) + spacer +
|
||||
button( RELOAD, "Reload Config" ) + spacer +
|
||||
button( LOGOUT, "Logout" ) + "<table cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
out.println( button( NEW, _("New") ) + spacer +
|
||||
button( REPLY, _("Reply") ) +
|
||||
button( REPLYALL, _("Reply All") ) +
|
||||
button( FORWARD, _("Forward") ) + spacer +
|
||||
button( DELETE, _("Delete") ) + spacer +
|
||||
button( REFRESH, _("Check Mail") ) + spacer +
|
||||
button( RELOAD, _("Reload Config") ) + spacer +
|
||||
button( LOGOUT, _("Logout") ) + "<table cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
"<tr><td colspan=\"8\"><hr></td></tr>\n<tr>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_SENDER, "Sender" ) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_SUBJECT, "Subject" ) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_DATE, "Date" ) + sortHeader( SORT_ID, "" ) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_SIZE, "Size" ) + "</th></tr>" );
|
||||
thSpacer + "<th>" + sortHeader( SORT_SENDER, _("Sender") ) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_SUBJECT, _("Subject") ) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_DATE, _("Date") ) + sortHeader( SORT_ID, "" ) + "</th>" +
|
||||
thSpacer + "<th>" + sortHeader( SORT_SIZE, _("Size") ) + "</th></tr>" );
|
||||
int bg = 0;
|
||||
int i = 0;
|
||||
for( Iterator it = sessionObject.folder.currentPageIterator(); it != null && it.hasNext(); ) {
|
||||
@@ -1635,26 +1636,26 @@ public class WebMail extends HttpServlet
|
||||
", invert=" + sessionObject.invert +
|
||||
", clear=" + sessionObject.clear );
|
||||
out.println( "<tr class=\"list" + bg + "\"><td><input type=\"checkbox\" class=\"optbox\" name=\"check" + i + "\" value=\"1\"" +
|
||||
( idChecked ? "checked" : "" ) + ">" + ( RELEASE ? "" : "" + i ) + "</td><td>" + link + mail.shortSender + "</a></td><td> </td><td>" + link + mail.shortSubject + "</a></td><td> </td><td>" + mail.formattedDate + "</a></td><td> </td><td>" + mail.size + " Bytes</a></td></tr>" );
|
||||
( idChecked ? "checked" : "" ) + ">" + ( RELEASE ? "" : "" + i ) + "</td><td>" + link + mail.shortSender + "</a></td><td> </td><td>" + link + mail.shortSubject + "</a></td><td> </td><td>" + mail.formattedDate + "</a></td><td> </td><td>" + _("{0} Bytes", mail.size) + "</a></td></tr>" );
|
||||
bg = 1 - bg;
|
||||
i++;
|
||||
}
|
||||
out.println( "<tr><td colspan=\"8\"><hr></td></tr>\n</table>" +
|
||||
button( MARKALL, "Mark All" ) +
|
||||
button( INVERT, "Invert Selection" ) +
|
||||
button( CLEAR, "Clear" ) +
|
||||
button( MARKALL, _("Mark All") ) +
|
||||
button( INVERT, _("Invert Selection") ) +
|
||||
button( CLEAR, _("Clear") ) +
|
||||
"<br>" +
|
||||
( sessionObject.folder.isFirstPage() ?
|
||||
button2( FIRSTPAGE, "First" ) + button2( PREVPAGE, "Previous" ) :
|
||||
button( FIRSTPAGE, "First" ) + button( PREVPAGE, "Previous" ) ) +
|
||||
" Page " + sessionObject.folder.getCurrentPage() + " of " + sessionObject.folder.getPages() + " " +
|
||||
button2( FIRSTPAGE, _("First") ) + button2( PREVPAGE, _("Previous") ) :
|
||||
button( FIRSTPAGE, _("First") ) + button( PREVPAGE, _("Previous") ) ) +
|
||||
" " + _("Page {0} of {1}", sessionObject.folder.getCurrentPage(), sessionObject.folder.getPages()) + " " +
|
||||
( sessionObject.folder.isLastPage() ?
|
||||
button2( NEXTPAGE, "Next" ) + button2( LASTPAGE, "Last" ) :
|
||||
button( NEXTPAGE, "Next" ) + button( LASTPAGE, "Last" ) ) +
|
||||
button2( NEXTPAGE, _("Next") ) + button2( LASTPAGE, _("Last") ) :
|
||||
button( NEXTPAGE, _("Next") ) + button( LASTPAGE, _("Last") ) ) +
|
||||
|
||||
"<br>" +
|
||||
"Pagesize: <input type=\"text\" name=\"" + PAGESIZE + "\" size=\"4\" value=\"" + sessionObject.folder.getPageSize() + "\">" +
|
||||
button( SETPAGESIZE, "Set" ) );
|
||||
_("Pagesize:") + " <input type=\"text\" name=\"" + PAGESIZE + "\" size=\"4\" value=\"" + sessionObject.folder.getPageSize() + "\">" +
|
||||
button( SETPAGESIZE, _("Set") ) );
|
||||
}
|
||||
/**
|
||||
*
|
||||
@@ -1664,7 +1665,7 @@ public class WebMail extends HttpServlet
|
||||
private void showMessage( PrintWriter out, SessionObject sessionObject )
|
||||
{
|
||||
if( sessionObject.reallyDelete ) {
|
||||
out.println( "<p class=\"error\">Really delete this messages? " + button( REALLYDELETE, "Yes, really delete it!" ) + "</p>" );
|
||||
out.println( "<p class=\"error\">" + _("Really delete this messages?") + " " + button( REALLYDELETE, _("Yes, really delete it!") ) + "</p>" );
|
||||
}
|
||||
Mail mail = sessionObject.mailCache.getMail( sessionObject.showUIDL, MailCache.FETCH_ALL );
|
||||
if( mail != null && mail.body != null && mail.part == null ) {
|
||||
@@ -1676,33 +1677,48 @@ public class WebMail extends HttpServlet
|
||||
out.println( quoteHTML( new String( mail.body.content, mail.body.offset, mail.body.length ) ) );
|
||||
out.println( "-->" );
|
||||
}
|
||||
out.println( button( NEW, "New" ) + spacer +
|
||||
button( REPLY, "Reply" ) +
|
||||
button( REPLYALL, "Reply All" ) +
|
||||
button( FORWARD, "Forward" ) + spacer +
|
||||
button( DELETE, "Delete" ) + spacer +
|
||||
( sessionObject.folder.isFirstElement( sessionObject.showUIDL ) ? button2( PREV, "Previous" ) : button( PREV, "Previous" ) ) +
|
||||
( sessionObject.folder.isLastElement( sessionObject.showUIDL ) ? button2( NEXT, "Next" ) : button( NEXT, "Next" ) ) + spacer +
|
||||
button( LIST, "Back to Folder" ) + spacer +
|
||||
button( RELOAD, "Reload Config" ) + spacer +
|
||||
button( LOGOUT, "Logout" ) );
|
||||
out.println( button( NEW, _("New") ) + spacer +
|
||||
button( REPLY, _("Reply") ) +
|
||||
button( REPLYALL, _("Reply All") ) +
|
||||
button( FORWARD, _("Forward") ) + spacer +
|
||||
button( DELETE, _("Delete") ) + spacer +
|
||||
( sessionObject.folder.isFirstElement( sessionObject.showUIDL ) ? button2( PREV, _("Previous") ) : button( PREV, _("Previous") ) ) +
|
||||
( sessionObject.folder.isLastElement( sessionObject.showUIDL ) ? button2( NEXT, _("Next") ) : button( NEXT, _("Next") ) ) + spacer +
|
||||
button( LIST, _("Back to Folder") ) + spacer +
|
||||
button( RELOAD, _("Reload Config") ) + spacer +
|
||||
button( LOGOUT, _("Logout") ) );
|
||||
if( mail != null ) {
|
||||
out.println( "<table cellspacing=\"0\" cellpadding=\"5\">\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\">From:</td><td align=\"left\">" + quoteHTML( mail.formattedSender ) + "</td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\">Date:</td><td align=\"left\">" + mail.quotedDate + "</td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\">Subject:</td><td align=\"left\">" + quoteHTML( mail.formattedSubject ) + "</td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\">" + _("From:") + "</td><td align=\"left\">" + quoteHTML( mail.formattedSender ) + "</td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\">" + _("Date:") + "</td><td align=\"left\">" + mail.quotedDate + "</td></tr>\n" +
|
||||
"<tr class=\"mailhead\"><td align=\"right\">" + _("Subject:") + "</td><td align=\"left\">" + quoteHTML( mail.formattedSubject ) + "</td></tr>\n" +
|
||||
"<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>" );
|
||||
if( mail.body != null ) {
|
||||
showPart( out, mail.part, 0, SHOW_HTML );
|
||||
}
|
||||
else {
|
||||
out.println( "<tr class=\"mailbody\"><td colspan=\"2\" align=\"center\"><p class=\"error\">Could not fetch mail body.</p></td></tr>" );
|
||||
out.println( "<tr class=\"mailbody\"><td colspan=\"2\" align=\"center\"><p class=\"error\">" + _("Could not fetch mail body.") + "</p></td></tr>" );
|
||||
}
|
||||
}
|
||||
else {
|
||||
out.println( "<tr class=\"mailbody\"><td colspan=\"2\" align=\"center\"><p class=\"error\">Could not fetch mail.</p></td></tr>" );
|
||||
out.println( "<tr class=\"mailbody\"><td colspan=\"2\" align=\"center\"><p class=\"error\">" + _("Could not fetch mail.") + "</p></td></tr>" );
|
||||
}
|
||||
out.println( "<tr><td colspan=\"2\" align=\"center\"><hr></td></tr>\n</table>" );
|
||||
}
|
||||
|
||||
/** translate */
|
||||
private static String _(String s) {
|
||||
return Messages.getString(s);
|
||||
}
|
||||
|
||||
/** translate */
|
||||
private static String _(String s, Object o) {
|
||||
return Messages.getString(s, o);
|
||||
}
|
||||
|
||||
/** translate */
|
||||
private static String _(String s, Object o, Object o2) {
|
||||
return Messages.getString(s, o, o2);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user