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 &amp; 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 &amp; 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&hellip;\" title=\"Leases expired ").append(DataHelper.formatDuration(0-timeToExpire));
-                    buf.append(" ago. Rebuilding&hellip;\"></td></tr>\n");                    
+                    buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"").append(_("Rebuilding")).append("&hellip;\" title=\"").append(_("Leases expired")).append(" ").append(DataHelper.formatDuration(0-timeToExpire));
+                    buf.append(" ").append(_("ago")).append(". ").append(_("Rebuilding")).append("&hellip;\"></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&hellip;\" title=\"Building tunnels&hellip;\"></td></tr>\n");
+                buf.append("<td><img src=\"/themes/console/images/local_inprogress.png\" alt=\"").append(_("Building")).append("&hellip;\" title=\"").append(_("Building tunnels")).append("&hellip;\"></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 &amp; 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 &amp; 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