From 2603f6fe4590fa7c59290b37fb419afa619070ab Mon Sep 17 00:00:00 2001 From: walking <walking@mail.i2p> Date: Tue, 27 Oct 2009 13:35:27 +0000 Subject: [PATCH] summarybar tagging --- .../src/net/i2p/router/web/SummaryHelper.java | 46 +++++----- apps/routerconsole/locale/messages_de.po | 91 ++++++++++++++++++- apps/routerconsole/locale/messages_zh.po | 89 +++++++++++++++++- 3 files changed, 201 insertions(+), 25 deletions(-) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index cffca854db..1f2cedbeb2 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -70,7 +70,7 @@ public class SummaryHelper extends HelperBase { long diff = Math.abs(ms); if (diff < 3000) return ""; - return " (" + DataHelper.formatDuration(diff) + " skew)"; + return " (" + DataHelper.formatDuration(diff) + " " + _("skew") + ")"; } public boolean allowReseed() { @@ -89,42 +89,42 @@ public class SummaryHelper extends HelperBase { private String reachability() { if (_context.router().getUptime() > 60*1000 && (!_context.router().gracefulShutdownInProgress()) && !_context.clientManager().isAlive()) - return "ERR-Client Manager I2CP Error - check logs"; // not a router problem but the user should know + return _("ERR-Client Manager I2CP Error - check logs"); // not a router problem but the user should know if (!_context.clock().getUpdatedSuccessfully()) - return "ERR-ClockSkew"; + return _("ERR-ClockSkew"); if (_context.router().isHidden()) - return "Hidden"; + return _("Hidden"); int status = _context.commSystem().getReachabilityStatus(); switch (status) { case CommSystemFacade.STATUS_OK: RouterAddress ra = _context.router().getRouterInfo().getTargetAddress("NTCP"); if (ra == null || (new NTCPAddress(ra)).isPubliclyRoutable()) - return "OK"; - return "ERR-Private TCP Address"; + return _("OK"); + return _("ERR-Private TCP Address"); case CommSystemFacade.STATUS_DIFFERENT: - return "ERR-SymmetricNAT"; + return _("ERR-SymmetricNAT"); case CommSystemFacade.STATUS_REJECT_UNSOLICITED: if (_context.router().getRouterInfo().getTargetAddress("NTCP") != null) - return "WARN-Firewalled with Inbound TCP Enabled"; + return _("WARN-Firewalled with Inbound TCP Enabled"); if (((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled()) - return "WARN-Firewalled and Floodfill"; + return _("WARN-Firewalled and Floodfill"); if (_context.router().getRouterInfo().getCapabilities().indexOf('O') >= 0) - return "WARN-Firewalled and Fast"; - return "Firewalled"; + return _("WARN-Firewalled and Fast"); + return _("Firewalled"); case CommSystemFacade.STATUS_HOSED: - return "ERR-UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart"; + return _("ERR-UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart"); case CommSystemFacade.STATUS_UNKNOWN: // fallthrough default: ra = _context.router().getRouterInfo().getTargetAddress("SSU"); if (ra == null && _context.router().getUptime() > 5*60*1000) { if (_context.getProperty(ConfigNetHelper.PROP_I2NP_NTCP_HOSTNAME) == null || _context.getProperty(ConfigNetHelper.PROP_I2NP_NTCP_PORT) == null) - return "ERR-UDP Disabled and Inbound TCP host/port not set"; + return _("ERR-UDP Disabled and Inbound TCP host/port not set"); else - return "WARN-Firewalled with UDP Disabled"; + return _("WARN-Firewalled with UDP Disabled"); } - return "Testing"; + return _("Testing"); } } @@ -357,7 +357,7 @@ public class SummaryHelper extends HelperBase { Collections.sort(clients, new AlphaComparator()); StringBuilder buf = new StringBuilder(512); - buf.append("<h3><a href=\"i2ptunnel/index.jsp\" target=\"_blank\" title=\"Add/remove/edit & control your client and server tunnels\">Local Destinations</a></h3><hr><div class=\"tunnels\"><table>"); + buf.append("<h3><a href=\"i2ptunnel/index.jsp\" target=\"_blank\" title=\"").append(_("Add/remove/edit & control your client and server tunnels")).append("\">").append(_("Local Destinations")).append("</a></h3><hr><div class=\"tunnels\"><table>"); for (Iterator iter = clients.iterator(); iter.hasNext(); ) { Destination client = (Destination)iter.next(); @@ -366,11 +366,11 @@ public class SummaryHelper extends HelperBase { buf.append("<tr><td align=\"right\"><img src=\"/themes/console/images/"); if (_context.clientManager().shouldPublishLeaseSet(h)) - buf.append("server.png\" alt=\"Server\" title=\"Server\">"); + buf.append("server.png\" alt=\"Server\" title=\"" + _("Server") + "\">"); else - buf.append("client.png\" alt=\"Client\" title=\"Client\">"); + buf.append("client.png\" alt=\"Client\" title=\"" + _("Client") + "\">"); buf.append("</td><td align=\"left\"><b><a href=\"tunnels.jsp#").append(h.toBase64().substring(0,4)); - buf.append("\" target=\"_top\" title=\"Show tunnels\">"); + buf.append("\" target=\"_top\" title=\"" + _("Show tunnels") + "\">"); if (name.length() < 16) buf.append(name); else @@ -381,15 +381,15 @@ public class SummaryHelper extends HelperBase { long timeToExpire = ls.getEarliestLeaseDate() - _context.clock().now(); if (timeToExpire < 0) { // red or yellow light - buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"Rebuilding…\" title=\"Leases expired ").append(DataHelper.formatDuration(0-timeToExpire)); - buf.append(" ago. Rebuilding…\"></td></tr>\n"); + buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"").append(_("Rebuilding")).append("…\" title=\"").append(_("Leases expired")).append(" ").append(DataHelper.formatDuration(0-timeToExpire)); + buf.append(" ").append(_("ago")).append(". ").append(_("Rebuilding")).append("…\"></td></tr>\n"); } else { // green light - buf.append("<td><img src=\"/themes/console/images/local_up.png\" alt=\"Ready\" title=\"Ready\"></td></tr>\n"); + buf.append("<td><img src=\"/themes/console/images/local_up.png\" alt=\"Ready\" title=\"").append(_("Ready")).append("\"></td></tr>\n"); } } else { // yellow light - buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"Building…\" title=\"Building tunnels…\"></td></tr>\n"); + buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"").append(_("Building")).append("…\" title=\"").append(_("Building tunnels")).append("…\"></td></tr>\n"); } } buf.append("</table></div><hr>\n"); diff --git a/apps/routerconsole/locale/messages_de.po b/apps/routerconsole/locale/messages_de.po index 8038c491af..1a0099deac 100644 --- a/apps/routerconsole/locale/messages_de.po +++ b/apps/routerconsole/locale/messages_de.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: I2P routerconsole\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-10-27 08:10+0000\n" +"POT-Creation-Date: 2009-10-27 12:45+0000\n" "PO-Revision-Date: 2009-10-19 12:50+0000\n" "Last-Translator: foo <foo@bar>\n" "Language-Team: foo <foo@bar>\n" @@ -419,6 +419,7 @@ msgid "" msgstr "" #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/config_jsp.java:534 +#: src/net/i2p/router/web/SummaryHelper.java:103 msgid "OK" msgstr "" @@ -427,6 +428,7 @@ msgid "Your UDP port does not appear to be firewalled." msgstr "" #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/config_jsp.java:538 +#: src/net/i2p/router/web/SummaryHelper.java:114 msgid "Firewalled" msgstr "" @@ -473,6 +475,7 @@ msgid "" msgstr "" #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/config_jsp.java:554 +#: src/net/i2p/router/web/SummaryHelper.java:127 msgid "Testing" msgstr "" @@ -482,6 +485,7 @@ msgstr "" #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/config_jsp.java:558 #: src/net/i2p/router/web/NetDbRenderer.java:237 +#: src/net/i2p/router/web/SummaryHelper.java:96 msgid "Hidden" msgstr "" @@ -1431,6 +1435,7 @@ msgstr "" #: src/net/i2p/router/web/ConfigClientsHandler.java:85 #: src/net/i2p/router/web/ConfigClientsHelper.java:17 #: src/net/i2p/router/web/SummaryBarRenderer.java:359 +#: src/net/i2p/router/web/SummaryHelper.java:371 msgid "Client" msgstr "" @@ -2120,6 +2125,7 @@ msgstr "" #: src/net/i2p/router/web/NetDbRenderer.java:237 #: src/net/i2p/router/web/NetDbRenderer.java:239 +#: src/net/i2p/router/web/SummaryHelper.java:385 msgid "ago" msgstr "" @@ -2397,6 +2403,89 @@ msgstr "" msgid "Backlog" msgstr "" +#: src/net/i2p/router/web/SummaryHelper.java:73 +msgid "skew" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:92 +msgid "ERR-Client Manager I2CP Error - check logs" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:94 +msgid "ERR-ClockSkew" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:104 +msgid "ERR-Private TCP Address" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:106 +msgid "ERR-SymmetricNAT" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:109 +msgid "WARN-Firewalled with Inbound TCP Enabled" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:111 +msgid "WARN-Firewalled and Floodfill" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:113 +msgid "WARN-Firewalled and Fast" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:116 +msgid "" +"ERR-UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and " +"restart" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:123 +msgid "ERR-UDP Disabled and Inbound TCP host/port not set" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:125 +msgid "WARN-Firewalled with UDP Disabled" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:360 +msgid "Add/remove/edit & control your client and server tunnels" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:360 +msgid "Local Destinations" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:369 +msgid "Server" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:373 +msgid "Show tunnels" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:384 +msgid "Leases expired" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:384 +#: src/net/i2p/router/web/SummaryHelper.java:385 +msgid "Rebuilding" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:388 +msgid "Ready" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:392 +msgid "Building" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:392 +msgid "Building tunnels" +msgstr "" + #: src/net/i2p/router/web/TunnelRenderer.java:40 #: src/net/i2p/router/web/TunnelRenderer.java:61 msgid "config" diff --git a/apps/routerconsole/locale/messages_zh.po b/apps/routerconsole/locale/messages_zh.po index 7301a7d528..bd60c4ae19 100644 --- a/apps/routerconsole/locale/messages_zh.po +++ b/apps/routerconsole/locale/messages_zh.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: I2P routerconsole\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2009-10-27 08:10+0000\n" +"POT-Creation-Date: 2009-10-27 12:45+0000\n" "PO-Revision-Date: \n" "Last-Translator: walking <walking@mail.i2p>\n" "Language-Team: \n" @@ -391,6 +391,7 @@ msgstr "如果å˜åœ¨é”™è¯¯ï¼Œ<a href=\"logs.jsp\">日志</a>å¯ä»¥å¸®åŠ©æ‚¨è¯Š # æš‚ä¸ç¿»è¯‘,确定/良好 å¯èƒ½å½±å“按钮的翻译 #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/config_jsp.java:534 +#: src/net/i2p/router/web/SummaryHelper.java:103 msgid "OK" msgstr "" @@ -399,6 +400,7 @@ msgid "Your UDP port does not appear to be firewalled." msgstr "您的UDP端å£ä¼¼ä¹Žä¸€åˆ‡æ£å¸¸ã€‚" #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/config_jsp.java:538 +#: src/net/i2p/router/web/SummaryHelper.java:114 msgid "Firewalled" msgstr "防ç«å¢™é˜»æŒ¡(Firewalled)" @@ -431,6 +433,7 @@ msgid "Also, some routers cannot correctly forward both TCP and UDP on a single msgstr "当然,æŸäº›è·¯ç”±å™¨å¯èƒ½æ— 法æ£ç¡®æ˜ å°„åŒæ—¶ä½¿ç”¨TCPå’ŒUDPå议的端å£ï¼Œæˆ–å˜åœ¨å…¶ä»–é™åˆ¶æˆ–缺陷,障ç¢äº†æ•°æ®è¿›å…¥I2P网络。" #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/config_jsp.java:554 +#: src/net/i2p/router/web/SummaryHelper.java:127 msgid "Testing" msgstr "测试ä¸(Testing)" @@ -440,6 +443,7 @@ msgstr "路由器æ£åœ¨æµ‹è¯•æ‚¨çš„UDP端å£æ˜¯å¦è¢«é˜²ç«å¢™é˜»æŒ¡ã€‚" #: ../jsp/WEB-INF/classes/net/i2p/router/web/jsp/config_jsp.java:558 #: src/net/i2p/router/web/NetDbRenderer.java:237 +#: src/net/i2p/router/web/SummaryHelper.java:96 msgid "Hidden" msgstr "éšè—(Hidden)" @@ -1304,6 +1308,7 @@ msgstr "客户程åºç´¢å¼•æ— 效" #: src/net/i2p/router/web/ConfigClientsHandler.java:85 #: src/net/i2p/router/web/ConfigClientsHelper.java:17 #: src/net/i2p/router/web/SummaryBarRenderer.java:359 +#: src/net/i2p/router/web/SummaryHelper.java:371 msgid "Client" msgstr "客户" @@ -1990,6 +1995,7 @@ msgstr "已更新" #: src/net/i2p/router/web/NetDbRenderer.java:237 #: src/net/i2p/router/web/NetDbRenderer.java:239 +#: src/net/i2p/router/web/SummaryHelper.java:385 msgid "ago" msgstr "å‰" @@ -2264,6 +2270,87 @@ msgstr "隧é“延迟" msgid "Backlog" msgstr "积压" +#: src/net/i2p/router/web/SummaryHelper.java:73 +msgid "skew" +msgstr "时滞" + +#: src/net/i2p/router/web/SummaryHelper.java:92 +msgid "ERR-Client Manager I2CP Error - check logs" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:94 +msgid "ERR-ClockSkew" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:104 +msgid "ERR-Private TCP Address" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:106 +msgid "ERR-SymmetricNAT" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:109 +msgid "WARN-Firewalled with Inbound TCP Enabled" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:111 +msgid "WARN-Firewalled and Floodfill" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:113 +msgid "WARN-Firewalled and Fast" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:116 +msgid "ERR-UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:123 +msgid "ERR-UDP Disabled and Inbound TCP host/port not set" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:125 +msgid "WARN-Firewalled with UDP Disabled" +msgstr "" + +#: src/net/i2p/router/web/SummaryHelper.java:360 +msgid "Add/remove/edit & control your client and server tunnels" +msgstr "æ·»åŠ ã€åˆ 除ã€ç¼–辑或控制客户程åºéš§é“å’ŒæœåŠ¡éš§é“" + +#: src/net/i2p/router/web/SummaryHelper.java:360 +msgid "Local Destinations" +msgstr "æœ¬åœ°ç›®æ ‡" + +#: src/net/i2p/router/web/SummaryHelper.java:369 +msgid "Server" +msgstr "æœåŠ¡" + +#: src/net/i2p/router/web/SummaryHelper.java:373 +msgid "Show tunnels" +msgstr "显示隧é“" + +#: src/net/i2p/router/web/SummaryHelper.java:384 +msgid "Leases expired" +msgstr "Lease已过期" + +#: src/net/i2p/router/web/SummaryHelper.java:384 +#: src/net/i2p/router/web/SummaryHelper.java:385 +msgid "Rebuilding" +msgstr "æ£åœ¨é‡å»º" + +#: src/net/i2p/router/web/SummaryHelper.java:388 +msgid "Ready" +msgstr "就绪" + +#: src/net/i2p/router/web/SummaryHelper.java:392 +msgid "Building" +msgstr "创建ä¸" + +#: src/net/i2p/router/web/SummaryHelper.java:392 +msgid "Building tunnels" +msgstr "æ£åœ¨éš§é“创建" + #: src/net/i2p/router/web/TunnelRenderer.java:40 #: src/net/i2p/router/web/TunnelRenderer.java:61 msgid "config" -- GitLab