tag and script fixups

This commit is contained in:
zzz
2009-10-29 23:22:51 +00:00
parent f9424dbd6d
commit b4d83b18fa
8 changed files with 47 additions and 33 deletions

View File

@ -16,7 +16,9 @@ do
# make list of java files newer than the .po file # make list of java files newer than the .po file
find src ../jsp/WEB-INF strings -name *.java -newer $i > $TMPFILE find src ../jsp/WEB-INF strings -name *.java -newer $i > $TMPFILE
if [ -s build/obj/net/i2p/router/web/messages_$LG.class -a ! -s $TMPFILE ] if [ -s build/obj/net/i2p/router/web/messages_$LG.class -a \
build/obj/net/i2p/router/web/messages_$LG.class -nt $i -a \
! -s $TMPFILE ]
then then
continue continue
fi fi

View File

@ -48,30 +48,21 @@ public class ConfigLoggingHelper extends HelperBase {
buf.append("<i>Valid levels are DEBUG, INFO, WARN, ERROR, CRIT</i>\n"); buf.append("<i>Valid levels are DEBUG, INFO, WARN, ERROR, CRIT</i>\n");
return buf.toString(); return buf.toString();
} }
private static String[] levels = { _x("CRIT"), _x("ERROR"), _x("WARN"), _x("INFO"), _x("DEBUG") };
public String getDefaultLogLevelBox() { public String getDefaultLogLevelBox() {
String cur = _context.logManager().getDefaultLimit(); String cur = _context.logManager().getDefaultLimit();
StringBuilder buf = new StringBuilder(128); StringBuilder buf = new StringBuilder(128);
buf.append("<select name=\"defaultloglevel\">\n"); buf.append("<select name=\"defaultloglevel\">\n");
buf.append("<option value=\"DEBUG\" "); for (int i = 0; i < levels.length; i++) {
if ("DEBUG".equals(cur)) buf.append(" selected=\"true\" "); String l = levels[i];
buf.append(">DEBUG</option>\n"); buf.append("<option value=\"").append(l).append("\" ");
if (l.equals(cur))
buf.append("<option value=\"INFO\" "); buf.append(" selected=\"true\" ");
if ("INFO".equals(cur)) buf.append(" selected=\"true\" "); buf.append('>').append(_(l)).append("</option>\n");
buf.append(">INFO</option>\n"); }
buf.append("<option value=\"WARN\" ");
if ("WARN".equals(cur)) buf.append(" selected=\"true\" ");
buf.append(">WARN</option>\n");
buf.append("<option value=\"ERROR\" ");
if ("ERROR".equals(cur)) buf.append(" selected=\"true\" ");
buf.append(">ERROR</option>\n");
buf.append("<option value=\"CRIT\" ");
if ("CRIT".equals(cur)) buf.append(" selected=\"true\" ");
buf.append(">CRIT</option>\n");
buf.append("</select>\n"); buf.append("</select>\n");
return buf.toString(); return buf.toString();

View File

@ -162,7 +162,7 @@ public class ConfigNetHelper extends HelperBase {
return kbytesToBits(getShareBandwidth()); return kbytesToBits(getShareBandwidth());
} }
private String kbytesToBits(int kbytes) { private String kbytesToBits(int kbytes) {
return DataHelper.formatSize(kbytes * 8 * 1024) + " bits per second"; return DataHelper.formatSize(kbytes * 8 * 1024) + ' ' + _("bits per second");
} }
public String getInboundBurstRate() { public String getInboundBurstRate() {
return "" + _context.bandwidthLimiter().getInboundBurstKBytesPerSecond(); return "" + _context.bandwidthLimiter().getInboundBurstKBytesPerSecond();

View File

@ -71,7 +71,7 @@ public class NetDbRenderer {
} }
} }
if (notFound) if (notFound)
buf.append(_("Router") + " ").append(routerPrefix).append(" " + _("not found in network database") ); buf.append(_("Router") + ' ').append(routerPrefix).append(' ' + _("not found in network database") );
} }
out.write(buf.toString()); out.write(buf.toString());
out.flush(); out.flush();
@ -93,19 +93,19 @@ public class NetDbRenderer {
LeaseSet ls = (LeaseSet)iter.next(); LeaseSet ls = (LeaseSet)iter.next();
Destination dest = ls.getDestination(); Destination dest = ls.getDestination();
Hash key = dest.calculateHash(); Hash key = dest.calculateHash();
buf.append("<b>LeaseSet: ").append(key.toBase64()); buf.append("<b>").append(_("LeaseSet")).append(": ").append(key.toBase64());
if (_context.clientManager().isLocal(dest)) { if (_context.clientManager().isLocal(dest)) {
buf.append(" (<a href=\"tunnels.jsp#" + key.toBase64().substring(0,4) + "\">" + _("Local") + "</a> "); buf.append(" (<a href=\"tunnels.jsp#" + key.toBase64().substring(0,4) + "\">" + _("Local") + "</a> ");
if (! _context.clientManager().shouldPublishLeaseSet(key)) if (! _context.clientManager().shouldPublishLeaseSet(key))
buf.append(_("Unpublished") + " "); buf.append(_("Unpublished") + ' ');
buf.append(_("Destination") + " "); buf.append(_("Destination") + ' ');
TunnelPoolSettings in = _context.tunnelManager().getInboundSettings(key); TunnelPoolSettings in = _context.tunnelManager().getInboundSettings(key);
if (in != null && in.getDestinationNickname() != null) if (in != null && in.getDestinationNickname() != null)
buf.append(in.getDestinationNickname()); buf.append(in.getDestinationNickname());
else else
buf.append(dest.toBase64().substring(0, 6)); buf.append(dest.toBase64().substring(0, 6));
} else { } else {
buf.append(" (" + _("Destination") + " "); buf.append(" (" + _("Destination") + ' ');
String host = _context.namingService().reverseLookup(dest); String host = _context.namingService().reverseLookup(dest);
if (host != null) if (host != null)
buf.append(host); buf.append(host);
@ -115,13 +115,13 @@ public class NetDbRenderer {
buf.append(")</b><br>\n"); buf.append(")</b><br>\n");
long exp = ls.getEarliestLeaseDate()-now; long exp = ls.getEarliestLeaseDate()-now;
if (exp > 0) if (exp > 0)
buf.append("Expires in ").append(DataHelper.formatDuration(exp)).append("<br>\n"); buf.append(_("Expires in {0}", DataHelper.formatDuration(exp))).append("<br>\n");
else else
buf.append("Expired ").append(DataHelper.formatDuration(0-exp)).append(" ago<br>\n"); buf.append(_("Expired {0} ago", DataHelper.formatDuration(0-exp))).append("<br>\n");
for (int i = 0; i < ls.getLeaseCount(); i++) { for (int i = 0; i < ls.getLeaseCount(); i++) {
buf.append("Lease ").append(i + 1).append(": " + _("Gateway") + " "); buf.append(_("Lease")).append(' ').append(i + 1).append(": " + _("Gateway") + ' ');
buf.append(_context.commSystem().renderPeerHTML(ls.getLease(i).getGateway())); buf.append(_context.commSystem().renderPeerHTML(ls.getLease(i).getGateway()));
buf.append(" " + _("Tunnel") + " ").append(ls.getLease(i).getTunnelId().getTunnelId()).append("<br>\n"); buf.append(' ' + _("Tunnel") + ' ').append(ls.getLease(i).getTunnelId().getTunnelId()).append("<br>\n");
} }
buf.append("<hr>\n"); buf.append("<hr>\n");
out.write(buf.toString()); out.write(buf.toString());
@ -225,7 +225,7 @@ public class NetDbRenderer {
if (full) { if (full) {
buf.append("[<a href=\"netdb.jsp\" >Back</a>]</th></tr><td>\n"); buf.append("[<a href=\"netdb.jsp\" >Back</a>]</th></tr><td>\n");
} else { } else {
buf.append("[<a href=\"netdb.jsp?r=").append(hash.substring(0, 6)).append("\" >Full entry</a>]</th></tr><td>\n"); buf.append("[<a href=\"netdb.jsp?r=").append(hash.substring(0, 6)).append("\" >").append(_("Full entry")).append("</a>]</th></tr><td>\n");
} }
} }
@ -269,4 +269,20 @@ public class NetDbRenderer {
private String _(String s) { private String _(String s) {
return Messages.getString(s, _context); return Messages.getString(s, _context);
} }
/**
* translate a string with a parameter
* This is a lot more expensive than _(s), so use sparingly.
*
* @param s string to be translated containing {0}
* The {0} will be replaced by the parameter.
* Single quotes must be doubled, i.e. ' -> '' in the string.
* @param o parameter, not translated.
* To tranlslate parameter also, use _("foo {0} bar", _("baz"))
* Do not double the single quotes in the parameter.
* Use autoboxing to call with ints, longs, floats, etc.
*/
private String _(String s, Object o) {
return Messages.getString(s, o, _context);
}
} }

View File

@ -37,7 +37,7 @@ public class SummaryBarRenderer {
buf.append(linkhelper.getContent()); buf.append(linkhelper.getContent());
} else { } else {
buf.append("<h3><a href=\"/configclients.jsp\" target=\"_top\" title=\"") buf.append("<h3><a href=\"/configclients.jsp\" target=\"_top\" title=\"")
.append("Configure startup of clients and webapps (services); manually start dormant services") .append(_("Configure startup of clients and webapps (services); manually start dormant services"))
.append("\">") .append("\">")
.append(_("I2P Services")) .append(_("I2P Services"))
.append("</a></h3>\n" + .append("</a></h3>\n" +

View File

@ -8,6 +8,7 @@
--> -->
<!-- You probably don't want to change anything from here down --> <!-- You probably don't want to change anything from here down -->
<target name="help" depends="all" />
<target name="all" > <target name="all" >
<echo message="Useful targets: " /> <echo message="Useful targets: " />
<echo message=" pkg: distclean then package everything up (installer, clean tarball, update tarball)" /> <echo message=" pkg: distclean then package everything up (installer, clean tarball, update tarball)" />

View File

@ -1,3 +1,7 @@
2009-10-29 zzz
* Console tag fixes, bundle script fix
* Add help target to build.xml
2009-10-28 zzz 2009-10-28 zzz
* Console: * Console:
- Rewrite TrustedUpdate version comparator, use for netdb version table - Rewrite TrustedUpdate version comparator, use for netdb version table

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */ /** deprecated */
public final static String ID = "Monotone"; public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION; public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 8; public final static long BUILD = 9;
/** for example "-test" */ /** for example "-test" */
public final static String EXTRA = ""; public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA; public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;