Console: Prevent two-word translations from splitting across lines in summary bar

This commit is contained in:
zzz
2014-12-09 15:16:41 +00:00
parent 4f3244e93b
commit 4e529a68d3
2 changed files with 23 additions and 13 deletions

View File

@ -53,7 +53,7 @@ public class NavHelper {
String tip = _tooltips.get(name); String tip = _tooltips.get(name);
if (tip != null) if (tip != null)
buf.append("title=\"").append(tip).append("\" "); buf.append("title=\"").append(tip).append("\" ");
buf.append('>').append(name).append("</a>"); buf.append('>').append(name.replace(" ", "&nbsp;")).append("</a>");
} }
return buf.toString(); return buf.toString();
} }

View File

@ -137,19 +137,19 @@ public class SummaryBarRenderer {
"<a href=\"/susimail/susimail\" target=\"_blank\" title=\"") "<a href=\"/susimail/susimail\" target=\"_blank\" title=\"")
.append(_("Anonymous webmail client")) .append(_("Anonymous webmail client"))
.append("\">") .append("\">")
.append(_("Email")) .append(nbsp(_("Email")))
.append("</a>\n" + .append("</a>\n" +
"<a href=\"/i2psnark/\" target=\"_blank\" title=\"") "<a href=\"/i2psnark/\" target=\"_blank\" title=\"")
.append(_("Built-in anonymous BitTorrent Client")) .append(_("Built-in anonymous BitTorrent Client"))
.append("\">") .append("\">")
.append(_("Torrents")) .append(nbsp(_("Torrents")))
.append("</a>\n" + .append("</a>\n" +
"<a href=\"http://127.0.0.1:7658/\" target=\"_blank\" title=\"") "<a href=\"http://127.0.0.1:7658/\" target=\"_blank\" title=\"")
.append(_("Local web server")) .append(_("Local web server"))
.append("\">") .append("\">")
.append(_("Website")) .append(nbsp(_("Website")))
.append("</a>\n") .append("</a>\n")
.append(NavHelper.getClientAppLinks(_context)) .append(NavHelper.getClientAppLinks(_context))
@ -171,31 +171,31 @@ public class SummaryBarRenderer {
"<a href=\"/tunnels\" target=\"_top\" title=\"") "<a href=\"/tunnels\" target=\"_top\" title=\"")
.append(_("View existing tunnels and tunnel build status")) .append(_("View existing tunnels and tunnel build status"))
.append("\">") .append("\">")
.append(_("Tunnels")) .append(nbsp(_("Tunnels")))
.append("</a>\n" + .append("</a>\n" +
"<a href=\"/peers\" target=\"_top\" title=\"") "<a href=\"/peers\" target=\"_top\" title=\"")
.append(_("Show all current peer connections")) .append(_("Show all current peer connections"))
.append("\">") .append("\">")
.append(_("Peers")) .append(nbsp(_("Peers")))
.append("</a>\n" + .append("</a>\n" +
"<a href=\"/profiles\" target=\"_top\" title=\"") "<a href=\"/profiles\" target=\"_top\" title=\"")
.append(_("Show recent peer performance profiles")) .append(_("Show recent peer performance profiles"))
.append("\">") .append("\">")
.append(_("Profiles")) .append(nbsp(_("Profiles")))
.append("</a>\n" + .append("</a>\n" +
"<a href=\"/netdb\" target=\"_top\" title=\"") "<a href=\"/netdb\" target=\"_top\" title=\"")
.append(_("Show list of all known I2P routers")) .append(_("Show list of all known I2P routers"))
.append("\">") .append("\">")
.append(_("NetDB")) .append(nbsp(_("NetDB")))
.append("</a>\n" + .append("</a>\n" +
"<a href=\"/logs\" target=\"_top\" title=\"") "<a href=\"/logs\" target=\"_top\" title=\"")
.append(_("Health Report")) .append(_("Health Report"))
.append("\">") .append("\">")
.append(_("Logs")) .append(nbsp(_("Logs")))
.append("</a>\n"); .append("</a>\n");
// "<a href=\"/jobs.jsp\" target=\"_top\" title=\"") // "<a href=\"/jobs.jsp\" target=\"_top\" title=\"")
@ -208,26 +208,26 @@ public class SummaryBarRenderer {
buf.append("<a href=\"/graphs\" target=\"_top\" title=\"") buf.append("<a href=\"/graphs\" target=\"_top\" title=\"")
.append(_("Graph router performance")) .append(_("Graph router performance"))
.append("\">") .append("\">")
.append(_("Graphs")) .append(nbsp(_("Graphs")))
.append("</a>\n"); .append("</a>\n");
} }
buf.append("<a href=\"/stats\" target=\"_top\" title=\"") buf.append("<a href=\"/stats\" target=\"_top\" title=\"")
.append(_("Textual router performance statistics")) .append(_("Textual router performance statistics"))
.append("\">") .append("\">")
.append(_("Stats")) .append(nbsp(_("Stats")))
.append("</a>\n" + .append("</a>\n" +
"<a href=\"/i2ptunnelmgr\" target=\"_top\" title=\"") "<a href=\"/i2ptunnelmgr\" target=\"_top\" title=\"")
.append(_("Local Destinations")) .append(_("Local Destinations"))
.append("\">") .append("\">")
.append(_("I2PTunnel")) .append(nbsp(_("I2PTunnel")))
.append("</a>\n" + .append("</a>\n" +
"<a href=\"/dns\" target=\"_top\" title=\"") "<a href=\"/dns\" target=\"_top\" title=\"")
.append(_("Manage your I2P hosts file here (I2P domain name resolution)")) .append(_("Manage your I2P hosts file here (I2P domain name resolution)"))
.append("\">") .append("\">")
.append(_("Addressbook")) .append(nbsp(_("Addressbook")))
.append("</a>\n"); .append("</a>\n");
if (_context.getBooleanProperty(HelperBase.PROP_ADVANCED)) if (_context.getBooleanProperty(HelperBase.PROP_ADVANCED))
@ -653,4 +653,14 @@ public class SummaryBarRenderer {
private String _(String s) { private String _(String s) {
return Messages.getString(s, _context); return Messages.getString(s, _context);
} }
/**
* Where the translation is to two words or more,
* prevent splitting across lines
*
* @since 0.9.18
*/
private static String nbsp(String s) {
return s.replace(" ", "&nbsp;");
}
} }