Give the summary bar sections string names (some already translated)

This commit is contained in:
str4d
2012-07-17 20:36:57 +00:00
parent 4cea0b6099
commit 5766b36b33
2 changed files with 25 additions and 3 deletions

View File

@ -45,6 +45,27 @@ public class SummaryBarRenderer {
{"HelpAndFAQ", "I2PServices", "I2PInternals", "General", "ShortGeneral", "NetworkReachability", {"HelpAndFAQ", "I2PServices", "I2PInternals", "General", "ShortGeneral", "NetworkReachability",
"UpdateStatus", "RestartStatus", "Peers", "FirewallAndReseedStatus", "Bandwidth", "Tunnels", "UpdateStatus", "RestartStatus", "Peers", "FirewallAndReseedStatus", "Bandwidth", "Tunnels",
"Congestion", "TunnelStatus", "Destinations", "NewsHeadings" }; "Congestion", "TunnelStatus", "Destinations", "NewsHeadings" };
static final Map<String, String> SECTION_NAMES;
static {
Map<String, String> aMap = new HashMap<String, String>();;
aMap.put("HelpAndFAQ", "Help &amp; FAQ");
aMap.put("I2PServices", "I2P Services");
aMap.put("I2PInternals", "I2P Internals");
aMap.put("General", "General");
aMap.put("ShortGeneral", "Short General");
aMap.put("NetworkReachability", "Network Reachability");
aMap.put("UpdateStatus", "Update Status");
aMap.put("RestartStatus", "Restart Status");
aMap.put("Peers", "Peers");
aMap.put("FirewallAndReseedStatus", "Firewall &amp; Reseed Status");
aMap.put("Bandwidth", "Bandwidth");
aMap.put("Tunnels", "Tunnels");
aMap.put("Congestion", "Congestion");
aMap.put("TunnelStatus", "Tunnel Status");
aMap.put("Destinations", "Local Destinations");
aMap.put("NewsHeadings", "News &amp; Updates");
SECTION_NAMES = Collections.unmodifiableMap(aMap);
}
private final RouterContext _context; private final RouterContext _context;
private final SummaryHelper _helper; private final SummaryHelper _helper;
@ -589,7 +610,7 @@ public class SummaryBarRenderer {
if (consoleNonce != null) { if (consoleNonce != null) {
// Set up title and pre-headings stuff. // Set up title and pre-headings stuff.
buf.append("<h3><a href=\"/configupdate\">") buf.append("<h3><a href=\"/configupdate\">")
.append(_("News & Updates")) .append(_("News &amp; Updates"))
.append("</a></h3><hr class=\"b\"><div class=\"newsheadings\">\n"); .append("</a></h3><hr class=\"b\"><div class=\"newsheadings\">\n");
// Get news content. // Get news content.
String newsContent = newshelper.getContent(); String newsContent = newshelper.getContent();

View File

@ -790,6 +790,7 @@ public class SummaryHelper extends HelperBase {
public String getConfigTable() { public String getConfigTable() {
String[] allSections = SummaryBarRenderer.ALL_SECTIONS; String[] allSections = SummaryBarRenderer.ALL_SECTIONS;
Map<String, String> sectionNames = SummaryBarRenderer.SECTION_NAMES;
List<String> sections = getSummaryBarSections("default"); List<String> sections = getSummaryBarSections("default");
TreeSet<String> sortedSections = new TreeSet(); TreeSet<String> sortedSections = new TreeSet();
@ -815,7 +816,7 @@ public class SummaryHelper extends HelperBase {
buf.append("<tr><td align=\"center\"><input type=\"checkbox\" class=\"optbox\" name=\"delete_") buf.append("<tr><td align=\"center\"><input type=\"checkbox\" class=\"optbox\" name=\"delete_")
.append(i) .append(i)
.append("\"></td><td align=\"left\">") .append("\"></td><td align=\"left\">")
.append(section) .append(_(sectionNames.get(section)))
.append("</td><td align=\"right\"><input type=\"hidden\" name=\"order_") .append("</td><td align=\"right\"><input type=\"hidden\" name=\"order_")
.append(i + "_" + section) .append(i + "_" + section)
.append("\" value=\"") .append("\" value=\"")
@ -860,7 +861,7 @@ public class SummaryHelper extends HelperBase {
for (String s : sortedSections) { for (String s : sortedSections) {
buf.append("<option value=\"").append(s).append("\">") buf.append("<option value=\"").append(s).append("\">")
.append(s).append("</option>\n"); .append(sectionNames.get(s)).append("</option>\n");
} }
buf.append("</select>\n" + buf.append("</select>\n" +