diff --git a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java index 2d676bdacffc8cda2a6bf3e55aa877f88d674702..94dc08b98aebcedf84b978bcfcec757751dd00a8 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java @@ -79,19 +79,21 @@ public class GraphHelper extends HelperBase { + "&width=" + (3 * _width) + "&height=" + (3 * _height) + "\" / target=\"_blank\">"); + String title = _("Combined bandwidth graph"); _out.write("<img class=\"statimage\" width=\"" + (_width + 83) + "\" height=\"" + (_height + 92) + "\" src=\"viewstat.jsp?stat=bw.combined" + "&periodCount=" + _periodCount + "&width=" + _width + "&height=" + (_height - 14) - + "\" alt=\"Combined bandwidth graph\" title=\"Combined bandwidth graph\"></a>\n"); + + "\" alt=\"" + title + "\" title=\"" + title + "\"></a>\n"); } for (Iterator iter = ordered.iterator(); iter.hasNext(); ) { SummaryListener lsnr = (SummaryListener)iter.next(); Rate r = lsnr.getRate(); - String title = r.getRateStat().getName() + " for " + DataHelper.formatDuration(_periodCount * r.getPeriod()); + // e.g. "statname for 60m" + String title = _("{0} for {1}", r.getRateStat().getName(), DataHelper.formatDuration(_periodCount * r.getPeriod())); _out.write("<a href=\"viewstat.jsp?stat=" + r.getRateStat().getName() + "&showEvents=" + _showEvents diff --git a/apps/routerconsole/java/src/net/i2p/router/web/HelperBase.java b/apps/routerconsole/java/src/net/i2p/router/web/HelperBase.java index 1d1d03d59239ef787a52017166f5e48d197d8102..802e059adf280f3daf6e9a7aa5f07ccc5dbd114e 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/HelperBase.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/HelperBase.java @@ -51,6 +51,11 @@ public abstract class HelperBase { return Messages.getString(s, o, _context); } + /** two params @since 0.7.14 */ + public String _(String s, Object o, Object o2) { + return Messages.getString(s, o, o2, _context); + } + /** translate (ngettext) @since 0.7.14 */ public String _(int n, String s, String p) { return Messages.getString(n, s, p, _context); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/Messages.java b/apps/routerconsole/java/src/net/i2p/router/web/Messages.java index 427ac9d8aefc78f1022dfa16332a6fc207d7bcb3..b50940fab5e72dabe98978e1b7797c935d2222ba 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/Messages.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/Messages.java @@ -30,6 +30,11 @@ public class Messages extends Translate { return Translate.getString(s, o, ctx, BUNDLE_NAME); } + /** two params @since 0.7.14 */ + public static String getString(String s, Object o, Object o2, I2PAppContext ctx) { + return Translate.getString(s, o, o2, ctx, BUNDLE_NAME); + } + /** translate (ngettext) @since 0.7.14 */ public static String getString(int n, String s, String p, I2PAppContext ctx) { return Translate.getString(n, s, p, ctx, BUNDLE_NAME); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java b/apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java index 0bcaaf315ae62fe59acd4dd23bfc9db62871442b..72c93330e23d2d78d085556990bd8b84fa8504bc 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/StatSummarizer.java @@ -170,6 +170,7 @@ public class StatSummarizer implements Runnable { def.setTimePeriod(start/1000, 0); def.setLowerLimit(0d); def.setBaseValue(1024); + // Note to translators: all runtime zh translation disabled in this file, no font available in RRD String title = _("Bandwidth usage"); if (!hideTitle) def.setTitle(title); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java index 7ee62510bac4dff2dc28c8db28e2163a6f955a56..f26426edca2435b1f62c94280ea6f7a4da96e33c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java @@ -80,6 +80,7 @@ class SummaryRenderer { String title; String p = DataHelper.formatDuration(_listener.getRate().getPeriod()); if (showEvents) + // Note to translators: all runtime zh translation disabled in this file, no font available in RRD title = name + ' ' + _("events in {0}", p); else title = name + ' ' + _("averaged for {0}", p); @@ -96,7 +97,11 @@ class SummaryRenderer { } else { // include the average value plotName = dsNames[0]; - descr = _listener.getRate().getRateStat().getDescription(); + // The descriptions are not tagged in the createRateStat calls + // (there are over 500 of them) + // but the descriptions for the default graphs are tagged in + // Strings.java + descr = _(_listener.getRate().getRateStat().getDescription()); } def.datasource(plotName, path, plotName, "AVERAGE", "MEMORY"); def.area(plotName, Color.BLUE, descr + "@r"); diff --git a/apps/routerconsole/java/strings/Strings.java b/apps/routerconsole/java/strings/Strings.java index 8d37b3b7638be04d7ba8a3317c4197da1c0177d1..b71541c78b0cfeb488b6ef0cfcfa3c72185c6e95 100644 --- a/apps/routerconsole/java/strings/Strings.java +++ b/apps/routerconsole/java/strings/Strings.java @@ -96,5 +96,12 @@ class Dummy { _("itag1"); _("itag2"); + // Descriptions for the stats that are graphed by default + // There are over 500 stats currently defined, we aren't going to tag them all + _("Low-level bandwidth receive rate"); // bw.recvRate + _("Low-level bandwidth send rate"); // bw.sendRate + _("How many peers we are actively talking with"); // router.activePeers + // router.memoryUsed currently has the max size in the description so it can't be tagged + } }