From ee1ed1bb82e42d5aa29df43621574092b2db4985 Mon Sep 17 00:00:00 2001 From: zzz <zzz@mail.i2p> Date: Thu, 19 Dec 2013 12:20:32 +0000 Subject: [PATCH] Nice message during graceful shutdown May need to tweak the wording --- .../net/i2p/router/web/ConfigRestartBean.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java index b70edf8bc0..1b97a2f20f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigRestartBean.java @@ -69,11 +69,23 @@ public class ConfigRestartBean { } else if (shuttingDown) { buf.append("<h4>"); buf.append(_("Shutdown in {0}", DataHelper.formatDuration2(timeRemaining), ctx)); + int tuns = ctx.tunnelManager().getParticipatingCount(); + if (tuns > 0) { + buf.append("<br>").append(ngettext("Please wait for routing commitment on {0} tunnel to expire", + "Please wait for routing commitments on {0} tunnels to expire", + tuns, ctx)); + } buf.append("</h4><hr>"); buttons(ctx, buf, urlBase, systemNonce, SET1); } else if (restarting) { buf.append("<h4>"); buf.append(_("Restart in {0}", DataHelper.formatDuration2(timeRemaining), ctx)); + int tuns = ctx.tunnelManager().getParticipatingCount(); + if (tuns > 0) { + buf.append("<br>").append(ngettext("Please wait for routing commitment on {0} tunnel to expire", + "Please wait for routing commitments on {0} tunnels to expire", + tuns, ctx)); + } buf.append("</h4><hr>"); buttons(ctx, buf, urlBase, systemNonce, SET2); } else { @@ -121,5 +133,10 @@ public class ConfigRestartBean { private static String _(String s, Object o, RouterContext ctx) { return Messages.getString(s, o, ctx); } + + /** translate (ngettext) @since 0.9.10 */ + private static String ngettext(String s, String p, int n, RouterContext ctx) { + return Messages.getString(n, s, p, ctx); + } } -- GitLab