From 22b9876b68a8fb6bc40d7b8c313d75dac678e116 Mon Sep 17 00:00:00 2001 From: dg2-new Date: Fri, 25 Sep 2015 19:55:36 +0000 Subject: [PATCH] Rename _() for translation to _t() for Java 9 compatibility (ticket #1456) --- apps/desktopgui/bundle-messages.sh | 10 +- .../i2p/desktopgui/ExternalTrayManager.java | 4 +- .../i2p/desktopgui/InternalTrayManager.java | 8 +- .../src/net/i2p/desktopgui/TrayManager.java | 4 +- .../gui/DesktopguiConfigurationFrame.java | 8 +- .../desktopgui/i18n/DesktopguiTranslator.java | 4 +- apps/i2psnark/java/bundle-messages.sh | 4 +- .../src/org/klomp/snark/I2PSnarkUtil.java | 2 +- .../src/org/klomp/snark/SnarkManager.java | 190 +++---- .../src/org/klomp/snark/web/FetchAndAdd.java | 24 +- .../org/klomp/snark/web/I2PSnarkServlet.java | 514 +++++++++--------- apps/i2psnark/locale/messages_ar.po | 2 +- apps/i2psnark/locale/messages_cs.po | 2 +- apps/i2psnark/locale/messages_de.po | 2 +- apps/i2psnark/locale/messages_en.po | 2 +- apps/i2psnark/locale/messages_es.po | 2 +- apps/i2psnark/locale/messages_fr.po | 2 +- apps/i2psnark/locale/messages_hu.po | 2 +- apps/i2psnark/locale/messages_it.po | 2 +- apps/i2psnark/locale/messages_nb.po | 2 +- apps/i2psnark/locale/messages_nl.po | 2 +- apps/i2psnark/locale/messages_pl.po | 2 +- apps/i2psnark/locale/messages_pt.po | 2 +- apps/i2psnark/locale/messages_pt_bR.po | 2 +- apps/i2psnark/locale/messages_ro.po | 2 +- apps/i2psnark/locale/messages_ru.po | 2 +- apps/i2psnark/locale/messages_sk.po | 2 +- apps/i2psnark/locale/messages_sv.po | 2 +- apps/i2psnark/locale/messages_vi.po | 2 +- apps/i2psnark/locale/messages_zh.po | 2 +- apps/i2ptunnel/java/bundle-messages-proxy.sh | 6 +- apps/i2ptunnel/java/bundle-messages.sh | 6 +- .../i2p/i2ptunnel/I2PTunnelHTTPClient.java | 22 +- .../i2ptunnel/I2PTunnelHTTPClientBase.java | 12 +- .../localServer/LocalHTTPServer.java | 28 +- .../net/i2p/i2ptunnel/ui/GeneralHelper.java | 8 +- .../src/net/i2p/i2ptunnel/web/EditBean.java | 10 +- .../src/net/i2p/i2ptunnel/web/IndexBean.java | 60 +- .../src/net/i2p/i2ptunnel/web/Messages.java | 8 +- apps/i2ptunnel/jsp/editClient.jsp | 194 +++---- apps/i2ptunnel/jsp/editServer.jsp | 200 +++---- apps/i2ptunnel/jsp/index.jsp | 116 ++-- apps/i2ptunnel/jsp/wizard.jsp | 192 +++---- apps/ministreaming/java/bundle-messages.sh | 4 +- .../client/streaming/I2PSocketException.java | 6 +- .../java/bundle-messages-countries.sh | 8 +- .../java/bundle-messages-news.sh | 6 +- apps/routerconsole/java/bundle-messages.sh | 10 +- .../router/update/ConsoleUpdateManager.java | 32 +- .../router/update/DevSU3UpdateChecker.java | 6 +- .../router/update/DevSU3UpdateHandler.java | 2 +- .../i2p/router/update/DevSU3UpdateRunner.java | 2 +- .../net/i2p/router/update/NewsFetcher.java | 8 +- .../router/update/PluginUpdateChecker.java | 4 +- .../router/update/PluginUpdateHandler.java | 4 +- .../i2p/router/update/PluginUpdateRunner.java | 84 +-- .../router/update/UnsignedUpdateChecker.java | 4 +- .../router/update/UnsignedUpdateHandler.java | 2 +- .../router/update/UnsignedUpdateRunner.java | 2 +- .../net/i2p/router/update/UpdateHandler.java | 2 +- .../net/i2p/router/update/UpdateRunner.java | 18 +- .../net/i2p/router/web/BanlistRenderer.java | 22 +- .../src/net/i2p/router/web/CSSHelper.java | 4 +- .../i2p/router/web/ConfigAdvancedHandler.java | 10 +- .../i2p/router/web/ConfigClientsHandler.java | 94 ++-- .../i2p/router/web/ConfigClientsHelper.java | 66 +-- .../net/i2p/router/web/ConfigHomeHandler.java | 22 +- .../i2p/router/web/ConfigKeyringHandler.java | 20 +- .../i2p/router/web/ConfigLoggingHandler.java | 4 +- .../i2p/router/web/ConfigLoggingHelper.java | 12 +- .../net/i2p/router/web/ConfigNavHelper.java | 2 +- .../net/i2p/router/web/ConfigNetHandler.java | 68 +-- .../net/i2p/router/web/ConfigNetHelper.java | 12 +- .../net/i2p/router/web/ConfigPeerHandler.java | 28 +- .../i2p/router/web/ConfigReseedHandler.java | 42 +- .../net/i2p/router/web/ConfigRestartBean.java | 26 +- .../i2p/router/web/ConfigServiceHandler.java | 56 +- .../i2p/router/web/ConfigStatsHandler.java | 10 +- .../net/i2p/router/web/ConfigStatsHelper.java | 4 +- .../i2p/router/web/ConfigSummaryHandler.java | 48 +- .../i2p/router/web/ConfigTunnelsHandler.java | 8 +- .../i2p/router/web/ConfigTunnelsHelper.java | 26 +- .../net/i2p/router/web/ConfigUIHandler.java | 30 +- .../net/i2p/router/web/ConfigUIHelper.java | 16 +- .../i2p/router/web/ConfigUpdateHandler.java | 38 +- .../i2p/router/web/ConfigUpdateHelper.java | 14 +- .../net/i2p/router/web/EventLogHelper.java | 28 +- .../src/net/i2p/router/web/FormHandler.java | 14 +- .../src/net/i2p/router/web/GraphHelper.java | 60 +- .../src/net/i2p/router/web/HelperBase.java | 10 +- .../src/net/i2p/router/web/HomeHelper.java | 14 +- .../net/i2p/router/web/JobQueueHelper.java | 36 +- .../src/net/i2p/router/web/LogsHelper.java | 16 +- .../java/src/net/i2p/router/web/Messages.java | 2 +- .../src/net/i2p/router/web/NetDbHelper.java | 4 +- .../src/net/i2p/router/web/NetDbRenderer.java | 76 +-- .../router/web/ProfileOrganizerRenderer.java | 110 ++-- .../net/i2p/router/web/ProfilesHelper.java | 4 +- .../src/net/i2p/router/web/SearchHelper.java | 2 +- .../net/i2p/router/web/StatSummarizer.java | 4 +- .../net/i2p/router/web/StatsGenerator.java | 56 +- .../i2p/router/web/SummaryBarRenderer.java | 190 +++---- .../src/net/i2p/router/web/SummaryHelper.java | 122 ++--- .../net/i2p/router/web/SummaryRenderer.java | 30 +- .../net/i2p/router/web/TunnelRenderer.java | 60 +- apps/routerconsole/java/strings/Strings.java | 100 ++-- apps/routerconsole/jsp/config.jsp | 32 +- apps/routerconsole/jsp/configadvanced.jsp | 28 +- apps/routerconsole/jsp/configclients.jsp | 98 ++-- apps/routerconsole/jsp/confighome.jsp | 44 +- apps/routerconsole/jsp/configkeyring.jsp | 24 +- apps/routerconsole/jsp/configlogging.jsp | 32 +- apps/routerconsole/jsp/confignet.jsp | 240 ++++---- apps/routerconsole/jsp/configpeer.jsp | 28 +- apps/routerconsole/jsp/configreseed.jsp | 84 +-- apps/routerconsole/jsp/configservice.jsp | 70 +-- apps/routerconsole/jsp/configsidebar.jsp | 14 +- apps/routerconsole/jsp/configstats.jsp | 26 +- apps/routerconsole/jsp/configtunnels.jsp | 24 +- apps/routerconsole/jsp/configui.jsp | 26 +- apps/routerconsole/jsp/configupdate.jsp | 44 +- apps/routerconsole/jsp/console.jsp | 4 +- apps/routerconsole/jsp/dns.jsp | 6 +- apps/routerconsole/jsp/error.jsp | 4 +- apps/routerconsole/jsp/error500.jsp | 20 +- apps/routerconsole/jsp/events.jsp | 2 +- apps/routerconsole/jsp/graph.jsp | 2 +- apps/routerconsole/jsp/graphs.jsp | 2 +- apps/routerconsole/jsp/home.jsp | 16 +- apps/routerconsole/jsp/i2ptunnelmgr.jsp | 6 +- apps/routerconsole/jsp/jobs.jsp | 2 +- apps/routerconsole/jsp/logs.jsp | 22 +- apps/routerconsole/jsp/netdb.jsp | 2 +- apps/routerconsole/jsp/news.jsp | 2 +- apps/routerconsole/jsp/nowebapp.jsp | 6 +- apps/routerconsole/jsp/peers.jsp | 2 +- apps/routerconsole/jsp/profiles.jsp | 2 +- apps/routerconsole/jsp/stats.jsp | 2 +- apps/routerconsole/jsp/summary.jsi | 6 +- apps/routerconsole/jsp/summaryajax.jsi | 2 +- apps/routerconsole/jsp/summaryframe.jsp | 6 +- apps/routerconsole/jsp/summarynoframe.jsi | 2 +- apps/routerconsole/jsp/torrents.jsp | 6 +- apps/routerconsole/jsp/tunnels.jsp | 2 +- apps/routerconsole/jsp/viewprofile.jsp | 4 +- apps/routerconsole/jsp/webmail.jsp | 6 +- apps/routerconsole/locale/messages_ar.po | 4 +- apps/routerconsole/locale/messages_cs.po | 4 +- apps/routerconsole/locale/messages_da.po | 4 +- apps/routerconsole/locale/messages_de.po | 4 +- apps/routerconsole/locale/messages_el.po | 4 +- apps/routerconsole/locale/messages_en.po | 4 +- apps/routerconsole/locale/messages_es.po | 4 +- apps/routerconsole/locale/messages_et.po | 4 +- apps/routerconsole/locale/messages_fi.po | 4 +- apps/routerconsole/locale/messages_fr.po | 4 +- apps/routerconsole/locale/messages_hu.po | 4 +- apps/routerconsole/locale/messages_it.po | 4 +- apps/routerconsole/locale/messages_ja.po | 4 +- apps/routerconsole/locale/messages_nb.po | 4 +- apps/routerconsole/locale/messages_nl.po | 4 +- apps/routerconsole/locale/messages_pl.po | 4 +- apps/routerconsole/locale/messages_pt.po | 4 +- apps/routerconsole/locale/messages_pt_BR.po | 4 +- apps/routerconsole/locale/messages_ro.po | 4 +- apps/routerconsole/locale/messages_ru.po | 4 +- apps/routerconsole/locale/messages_sv.po | 4 +- apps/routerconsole/locale/messages_tr.po | 4 +- apps/routerconsole/locale/messages_uk.po | 4 +- apps/routerconsole/locale/messages_vi.po | 4 +- apps/routerconsole/locale/messages_zh.po | 4 +- apps/susidns/src/bundle-messages.sh | 6 +- .../java/src/i2p/susi/dns/AddressBean.java | 42 +- .../src/i2p/susi/dns/AddressbookBean.java | 40 +- .../src/java/src/i2p/susi/dns/BaseBean.java | 6 +- .../src/java/src/i2p/susi/dns/ConfigBean.java | 12 +- .../src/java/src/i2p/susi/dns/Messages.java | 4 +- .../src/i2p/susi/dns/NamingServiceBean.java | 42 +- .../src/i2p/susi/dns/SubscriptionsBean.java | 14 +- apps/susidns/src/jsp/addressbook.jsp | 70 +-- apps/susidns/src/jsp/config.jsp | 64 +-- apps/susidns/src/jsp/details.jsp | 56 +- apps/susidns/src/jsp/index.jsp | 44 +- apps/susidns/src/jsp/subscriptions.jsp | 36 +- apps/susimail/bundle-messages.sh | 4 +- apps/susimail/locale/messages_cs.po | 10 +- apps/susimail/locale/messages_da.po | 10 +- apps/susimail/locale/messages_de.po | 10 +- apps/susimail/locale/messages_en.po | 10 +- apps/susimail/locale/messages_es.po | 10 +- apps/susimail/locale/messages_fi.po | 10 +- apps/susimail/locale/messages_fr.po | 10 +- apps/susimail/locale/messages_hu.po | 10 +- apps/susimail/locale/messages_in.po | 10 +- apps/susimail/locale/messages_it.po | 10 +- apps/susimail/locale/messages_ja.po | 10 +- apps/susimail/locale/messages_mg.po | 10 +- apps/susimail/locale/messages_nl.po | 10 +- apps/susimail/locale/messages_pl.po | 10 +- apps/susimail/locale/messages_pt.po | 10 +- apps/susimail/locale/messages_pt_BR.po | 10 +- apps/susimail/locale/messages_ro.po | 10 +- apps/susimail/locale/messages_ru.po | 10 +- apps/susimail/locale/messages_sq.po | 10 +- apps/susimail/locale/messages_sv.po | 10 +- apps/susimail/locale/messages_uk.po | 10 +- apps/susimail/locale/messages_vi.po | 10 +- apps/susimail/locale/messages_zh.po | 10 +- .../src/src/i2p/susi/webmail/MailPart.java | 4 +- .../src/src/i2p/susi/webmail/Messages.java | 2 +- .../src/src/i2p/susi/webmail/WebMail.java | 274 +++++----- .../i2p/susi/webmail/pop3/POP3MailBox.java | 16 +- .../src/i2p/susi/webmail/smtp/SMTPClient.java | 16 +- core/java/src/net/i2p/data/DataHelper.java | 6 +- core/java/src/net/i2p/util/LogWriterBase.java | 4 +- core/java/src/net/i2p/util/Translate.java | 2 +- history.txt | 3 + router/java/src/net/i2p/router/Blocklist.java | 12 +- .../src/net/i2p/router/RouterVersion.java | 2 +- .../i2p/router/networkdb/reseed/Reseeder.java | 24 +- .../transport/CommSystemFacadeImpl.java | 4 +- .../i2p/router/transport/TransportImpl.java | 4 +- .../router/transport/TransportManager.java | 68 +-- .../src/net/i2p/router/transport/UPnP.java | 74 +-- .../net/i2p/router/transport/UPnPManager.java | 4 +- .../router/transport/ntcp/NTCPTransport.java | 36 +- .../router/transport/udp/UDPTransport.java | 86 +-- 227 files changed, 2930 insertions(+), 2927 deletions(-) diff --git a/apps/desktopgui/bundle-messages.sh b/apps/desktopgui/bundle-messages.sh index 957199923c..997c768876 100644 --- a/apps/desktopgui/bundle-messages.sh +++ b/apps/desktopgui/bundle-messages.sh @@ -64,19 +64,19 @@ do echo "Updating the $i file from the tags..." # extract strings from java and jsp files, and update messages.po files # translate calls must be one of the forms: - # _("foo") + # _t("foo") # _x("foo") - # intl._("foo") + # intl._t("foo") # intl.title("foo") - # handler._("foo") - # formhandler._("foo") + # handler._t("foo") + # formhandler._t("foo") # net.i2p.router.web.Messages.getString("foo") # In a jsp, you must use a helper or handler that has the context set. # To start a new translation, copy the header from an old translation to the new .po file, # then ant distclean updater. find $JPATHS -name *.java > $TMPFILE xgettext -f $TMPFILE -F -L java --from-code=UTF-8 --add-comments\ - --keyword=_ --keyword=_x --keyword=intl._ --keyword=intl.title \ + --keyword=_t --keyword=_x --keyword=intl._ --keyword=intl.title \ --keyword=handler._ --keyword=formhandler._ \ --keyword=net.i2p.router.web.Messages.getString \ -o ${i}t diff --git a/apps/desktopgui/src/net/i2p/desktopgui/ExternalTrayManager.java b/apps/desktopgui/src/net/i2p/desktopgui/ExternalTrayManager.java index 6fea46fef5..2a3a16b63e 100644 --- a/apps/desktopgui/src/net/i2p/desktopgui/ExternalTrayManager.java +++ b/apps/desktopgui/src/net/i2p/desktopgui/ExternalTrayManager.java @@ -20,7 +20,7 @@ public class ExternalTrayManager extends TrayManager { @Override public PopupMenu getMainMenu() { PopupMenu popup = new PopupMenu(); - MenuItem startItem = new MenuItem(_("Start I2P")); + MenuItem startItem = new MenuItem(_t("Start I2P")); startItem.addActionListener(new ActionListener() { @Override @@ -35,7 +35,7 @@ public class ExternalTrayManager extends TrayManager { @Override protected void done() { - trayIcon.displayMessage(_("Starting"), _("I2P is starting!"), TrayIcon.MessageType.INFO); + trayIcon.displayMessage(_t("Starting"), _t("I2P is starting!"), TrayIcon.MessageType.INFO); //Hide the tray icon. //We cannot stop the desktopgui program entirely, //since that risks killing the I2P process as well. diff --git a/apps/desktopgui/src/net/i2p/desktopgui/InternalTrayManager.java b/apps/desktopgui/src/net/i2p/desktopgui/InternalTrayManager.java index e1247dde6c..1cb464308c 100644 --- a/apps/desktopgui/src/net/i2p/desktopgui/InternalTrayManager.java +++ b/apps/desktopgui/src/net/i2p/desktopgui/InternalTrayManager.java @@ -23,7 +23,7 @@ public class InternalTrayManager extends TrayManager { public PopupMenu getMainMenu() { PopupMenu popup = new PopupMenu(); - MenuItem browserLauncher = new MenuItem(_("Launch I2P Browser")); + MenuItem browserLauncher = new MenuItem(_t("Launch I2P Browser")); browserLauncher.addActionListener(new ActionListener() { @Override @@ -47,7 +47,7 @@ public class InternalTrayManager extends TrayManager { }.execute(); } }); - MenuItem desktopguiConfigurationLauncher = new MenuItem(_("Configure desktopgui")); + MenuItem desktopguiConfigurationLauncher = new MenuItem(_t("Configure desktopgui")); desktopguiConfigurationLauncher.addActionListener(new ActionListener() { @Override @@ -64,7 +64,7 @@ public class InternalTrayManager extends TrayManager { } }); - MenuItem restartItem = new MenuItem(_("Restart I2P")); + MenuItem restartItem = new MenuItem(_t("Restart I2P")); restartItem.addActionListener(new ActionListener() { @Override @@ -82,7 +82,7 @@ public class InternalTrayManager extends TrayManager { } }); - MenuItem stopItem = new MenuItem(_("Stop I2P")); + MenuItem stopItem = new MenuItem(_t("Stop I2P")); stopItem.addActionListener(new ActionListener() { @Override diff --git a/apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java b/apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java index f124ee3f62..227050735c 100644 --- a/apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java +++ b/apps/desktopgui/src/net/i2p/desktopgui/TrayManager.java @@ -78,7 +78,7 @@ public abstract class TrayManager { return image; } - protected static String _(String s) { - return DesktopguiTranslator._(s); + protected static String _t(String s) { + return DesktopguiTranslator._t(s); } } diff --git a/apps/desktopgui/src/net/i2p/desktopgui/gui/DesktopguiConfigurationFrame.java b/apps/desktopgui/src/net/i2p/desktopgui/gui/DesktopguiConfigurationFrame.java index 1e49f66093..a697c5779f 100644 --- a/apps/desktopgui/src/net/i2p/desktopgui/gui/DesktopguiConfigurationFrame.java +++ b/apps/desktopgui/src/net/i2p/desktopgui/gui/DesktopguiConfigurationFrame.java @@ -40,10 +40,10 @@ public class DesktopguiConfigurationFrame extends javax.swing.JFrame { cancelButton = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); - setTitle(_("Tray icon configuration")); + setTitle(_t("Tray icon configuration")); desktopguiEnabled.setSelected(true); - desktopguiEnabled.setText(_("Should tray icon be enabled?")); + desktopguiEnabled.setText(_t("Should tray icon be enabled?")); desktopguiEnabled.setActionCommand("shouldDesktopguiBeEnabled"); okButton.setText("OK"); @@ -98,8 +98,8 @@ public class DesktopguiConfigurationFrame extends javax.swing.JFrame { configureDesktopgui(); }//GEN-LAST:event_okButtonMouseReleased - protected static String _(String s) { - return DesktopguiTranslator._(s); + protected static String _t(String s) { + return DesktopguiTranslator._t(s); } private void configureDesktopgui() { diff --git a/apps/desktopgui/src/net/i2p/desktopgui/i18n/DesktopguiTranslator.java b/apps/desktopgui/src/net/i2p/desktopgui/i18n/DesktopguiTranslator.java index e95cbc01f2..3778c4ad93 100644 --- a/apps/desktopgui/src/net/i2p/desktopgui/i18n/DesktopguiTranslator.java +++ b/apps/desktopgui/src/net/i2p/desktopgui/i18n/DesktopguiTranslator.java @@ -16,11 +16,11 @@ public class DesktopguiTranslator { return ctx; } - public static String _(String s) { + public static String _t(String s) { return Translate.getString(s, getRouterContext(), BUNDLE_NAME); } - public static String _(String s, Object o) { + public static String _t(String s, Object o) { return Translate.getString(s, o, getRouterContext(), BUNDLE_NAME); } } diff --git a/apps/i2psnark/java/bundle-messages.sh b/apps/i2psnark/java/bundle-messages.sh index 033e1195b7..9632ee9584 100755 --- a/apps/i2psnark/java/bundle-messages.sh +++ b/apps/i2psnark/java/bundle-messages.sh @@ -63,13 +63,13 @@ do echo "Updating the $i file from the tags..." # extract strings from java and jsp files, and update messages.po files # translate calls must be one of the forms: - # _("foo") + # _t("foo") # _x("foo") # To start a new translation, copy the header from an old translation to the new .po file, # then ant distclean poupdate. find $JPATHS -name *.java > $TMPFILE xgettext -f $TMPFILE -F -L java --from-code=UTF-8 --add-comments\ - --keyword=_ --keyword=_x \ + --keyword=_t --keyword=_x \ -o ${i}t if [ $? -ne 0 ] then diff --git a/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java b/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java index 75570e04ae..e75ef301e4 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java +++ b/apps/i2psnark/java/src/org/klomp/snark/I2PSnarkUtil.java @@ -660,7 +660,7 @@ public class I2PSnarkUtil { * The {0} will be replaced by the parameter. * Single quotes must be doubled, i.e. ' -> '' in the string. * @param o parameter, not translated. - * To tranlslate parameter also, use _("foo {0} bar", _("baz")) + * To tranlslate parameter also, use _t("foo {0} bar", _t("baz")) * Do not double the single quotes in the parameter. * Use autoboxing to call with ints, longs, floats, etc. */ diff --git a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java index ee9aa5ccb6..bcb4fa34c2 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java +++ b/apps/i2psnark/java/src/org/klomp/snark/SnarkManager.java @@ -776,9 +776,9 @@ public class SnarkManager implements CompleteListener { _util.setMaxUploaders(limit); changed = true; _config.setProperty(PROP_UPLOADERS_TOTAL, Integer.toString(limit)); - addMessage(_("Total uploaders limit changed to {0}", limit)); + addMessage(_t("Total uploaders limit changed to {0}", limit)); } else { - addMessage(_("Minimum total uploaders limit is {0}", Snark.MIN_TOTAL_UPLOADERS)); + addMessage(_t("Minimum total uploaders limit is {0}", Snark.MIN_TOTAL_UPLOADERS)); } } } @@ -790,9 +790,9 @@ public class SnarkManager implements CompleteListener { _util.setMaxUpBW(limit); changed = true; _config.setProperty(PROP_UPBW_MAX, Integer.toString(limit)); - addMessage(_("Up BW limit changed to {0}KBps", limit)); + addMessage(_t("Up BW limit changed to {0}KBps", limit)); } else { - addMessage(_("Minimum up bandwidth limit is {0}KBps", MIN_UP_BW)); + addMessage(_t("Minimum up bandwidth limit is {0}KBps", MIN_UP_BW)); } } } @@ -804,7 +804,7 @@ public class SnarkManager implements CompleteListener { _util.setStartupDelay(minutes); changed = true; _config.setProperty(PROP_STARTUP_DELAY, Integer.toString(minutes)); - addMessage(_("Startup delay changed to {0}", DataHelper.formatDuration2(minutes * (60L * 1000)))); + addMessage(_t("Startup delay changed to {0}", DataHelper.formatDuration2(minutes * (60L * 1000)))); } } @@ -815,9 +815,9 @@ public class SnarkManager implements CompleteListener { changed = true; _config.setProperty(PROP_REFRESH_DELAY, Integer.toString(secs)); if (secs >= 0) - addMessage(_("Refresh time changed to {0}", DataHelper.formatDuration2(secs * 1000))); + addMessage(_t("Refresh time changed to {0}", DataHelper.formatDuration2(secs * 1000))); else - addMessage(_("Refresh disabled")); + addMessage(_t("Refresh disabled")); } } catch (NumberFormatException nfe) {} } @@ -833,7 +833,7 @@ public class SnarkManager implements CompleteListener { changed = true; pageSize = Integer.toString(size); _config.setProperty(PROP_PAGE_SIZE, pageSize); - addMessage(_("Page size changed to {0}", pageSize)); + addMessage(_t("Page size changed to {0}", pageSize)); } } catch (NumberFormatException nfe) {} } @@ -842,18 +842,18 @@ public class SnarkManager implements CompleteListener { dataDir = DataHelper.stripHTML(dataDir.trim()); File dd = new File(dataDir); if (!dd.isAbsolute()) { - addMessage(_("Data directory must be an absolute path") + ": " + dataDir); + addMessage(_t("Data directory must be an absolute path") + ": " + dataDir); } else if (!dd.exists()) { - addMessage(_("Data directory does not exist") + ": " + dataDir); + addMessage(_t("Data directory does not exist") + ": " + dataDir); } else if (!dd.isDirectory()) { - addMessage(_("Not a directory") + ": " + dataDir); + addMessage(_t("Not a directory") + ": " + dataDir); } else if (!dd.canRead()) { - addMessage(_("Unreadable") + ": " + dataDir); + addMessage(_t("Unreadable") + ": " + dataDir); } else { changed = true; interruptMonitor = true; _config.setProperty(PROP_DIR, dataDir); - addMessage(_("Data directory changed to {0}", dataDir)); + addMessage(_t("Data directory changed to {0}", dataDir)); } } @@ -908,37 +908,37 @@ public class SnarkManager implements CompleteListener { p.putAll(opts); _util.setI2CPConfig(i2cpHost, port, p); _util.setMaxUpBW(getInt(PROP_UPBW_MAX, DEFAULT_MAX_UP_BW)); - addMessage(_("I2CP and tunnel changes will take effect after stopping all torrents")); + addMessage(_t("I2CP and tunnel changes will take effect after stopping all torrents")); } else if (!reconnect) { // The usual case, the other two are if not in router context _config.setProperty(PROP_I2CP_OPTS, i2cpOpts.trim()); - addMessage(_("I2CP options changed to {0}", i2cpOpts)); + addMessage(_t("I2CP options changed to {0}", i2cpOpts)); _util.setI2CPConfig(oldI2CPHost, oldI2CPPort, opts); } else { // Won't happen, I2CP host/port, are hidden in the GUI if in router context if (_util.connected()) { _util.disconnect(); - addMessage(_("Disconnecting old I2CP destination")); + addMessage(_t("Disconnecting old I2CP destination")); } - addMessage(_("I2CP settings changed to {0}", i2cpHost + ':' + port + ' ' + i2cpOpts)); + addMessage(_t("I2CP settings changed to {0}", i2cpHost + ':' + port + ' ' + i2cpOpts)); _util.setI2CPConfig(i2cpHost, port, opts); _util.setMaxUpBW(getInt(PROP_UPBW_MAX, DEFAULT_MAX_UP_BW)); boolean ok = _util.connect(); if (!ok) { - addMessage(_("Unable to connect with the new settings, reverting to the old I2CP settings")); + addMessage(_t("Unable to connect with the new settings, reverting to the old I2CP settings")); _util.setI2CPConfig(oldI2CPHost, oldI2CPPort, oldOpts); ok = _util.connect(); if (!ok) - addMessage(_("Unable to reconnect with the old settings!")); + addMessage(_t("Unable to reconnect with the old settings!")); } else { - addMessage(_("Reconnected on the new I2CP destination")); + addMessage(_t("Reconnected on the new I2CP destination")); _config.setProperty(PROP_I2CP_HOST, i2cpHost.trim()); _config.setProperty(PROP_I2CP_PORT, "" + port); _config.setProperty(PROP_I2CP_OPTS, i2cpOpts.trim()); // no PeerAcceptors/I2PServerSockets to deal with, since all snarks are inactive for (Snark snark : _snarks.values()) { if (snark.restartAcceptor()) { - addMessage(_("I2CP listener restarted for \"{0}\"", snark.getBaseName())); + addMessage(_t("I2CP listener restarted for \"{0}\"", snark.getBaseName())); // this is the common ConnectionAcceptor, so we only need to do it once break; } @@ -952,44 +952,44 @@ public class SnarkManager implements CompleteListener { _config.setProperty(PROP_FILES_PUBLIC, Boolean.toString(filesPublic)); _util.setFilesPublic(filesPublic); if (filesPublic) - addMessage(_("New files will be publicly readable")); + addMessage(_t("New files will be publicly readable")); else - addMessage(_("New files will not be publicly readable")); + addMessage(_t("New files will not be publicly readable")); changed = true; } if (shouldAutoStart() != autoStart) { _config.setProperty(PROP_AUTO_START, Boolean.toString(autoStart)); if (autoStart) - addMessage(_("Enabled autostart")); + addMessage(_t("Enabled autostart")); else - addMessage(_("Disabled autostart")); + addMessage(_t("Disabled autostart")); changed = true; } if (_util.shouldUseOpenTrackers() != useOpenTrackers) { _config.setProperty(PROP_USE_OPENTRACKERS, useOpenTrackers + ""); if (useOpenTrackers) - addMessage(_("Enabled open trackers - torrent restart required to take effect.")); + addMessage(_t("Enabled open trackers - torrent restart required to take effect.")); else - addMessage(_("Disabled open trackers - torrent restart required to take effect.")); + addMessage(_t("Disabled open trackers - torrent restart required to take effect.")); _util.setUseOpenTrackers(useOpenTrackers); changed = true; } if (_util.shouldUseDHT() != useDHT) { _config.setProperty(PROP_USE_DHT, Boolean.toString(useDHT)); if (useDHT) - addMessage(_("Enabled DHT.")); + addMessage(_t("Enabled DHT.")); else - addMessage(_("Disabled DHT.")); + addMessage(_t("Disabled DHT.")); if (_util.connected()) - addMessage(_("DHT change requires tunnel shutdown and reopen")); + addMessage(_t("DHT change requires tunnel shutdown and reopen")); _util.setUseDHT(useDHT); changed = true; } if (theme != null) { if(!theme.equals(_config.getProperty(PROP_THEME))) { _config.setProperty(PROP_THEME, theme); - addMessage(_("{0} theme loaded, return to main i2psnark page to view.", theme)); + addMessage(_t("{0} theme loaded, return to main i2psnark page to view.", theme)); changed = true; } } @@ -999,7 +999,7 @@ public class SnarkManager implements CompleteListener { // Data dir changed. this will stop and remove all old torrents, and add the new ones _monitor.interrupt(); } else { - addMessage(_("Configuration unchanged.")); + addMessage(_t("Configuration unchanged.")); } } @@ -1031,7 +1031,7 @@ public class SnarkManager implements CompleteListener { if (ot == null) ot = getListConfig(PROP_OPENTRACKERS, DEFAULT_OPENTRACKERS); _util.setOpenTrackers(ot); - addMessage(_("Open Tracker list changed - torrent restart required to take effect.")); + addMessage(_t("Open Tracker list changed - torrent restart required to take effect.")); saveConfig(); } @@ -1041,7 +1041,7 @@ public class SnarkManager implements CompleteListener { */ public void savePrivateTrackers(List pt) { setListConfig(PROP_PRIVATETRACKERS, pt); - addMessage(_("Private tracker list changed - affects newly created torrents only.")); + addMessage(_t("Private tracker list changed - affects newly created torrents only.")); saveConfig(); } @@ -1087,7 +1087,7 @@ public class SnarkManager implements CompleteListener { DataHelper.storeProps(_config, _configFile); } } catch (IOException ioe) { - addMessage(_("Unable to save the config to {0}", _configFile.getAbsolutePath())); + addMessage(_t("Unable to save the config to {0}", _configFile.getAbsolutePath())); } } @@ -1168,10 +1168,10 @@ public class SnarkManager implements CompleteListener { */ private void addTorrent(String filename, File baseFile, boolean dontAutoStart, File dataDir) { if ((!dontAutoStart) && !_util.connected()) { - addMessage(_("Connecting to I2P")); + addMessage(_t("Connecting to I2P")); boolean ok = _util.connect(); if (!ok) { - addMessage(_("Error connecting to I2P - check your I2CP settings!")); + addMessage(_t("Error connecting to I2P - check your I2CP settings!")); return; } } @@ -1180,7 +1180,7 @@ public class SnarkManager implements CompleteListener { filename = sfile.getCanonicalPath(); } catch (IOException ioe) { _log.error("Unable to add the torrent " + filename, ioe); - addMessage(_("Error: Could not add the torrent {0}", filename) + ": " + ioe); + addMessage(_t("Error: Could not add the torrent {0}", filename) + ": " + ioe); return; } if (dataDir == null) @@ -1203,7 +1203,7 @@ public class SnarkManager implements CompleteListener { fis = new FileInputStream(sfile); } catch (IOException ioe) { // catch this here so we don't try do delete it below - addMessage(_("Cannot open \"{0}\"", sfile.getName()) + ": " + ioe.getMessage()); + addMessage(_t("Cannot open \"{0}\"", sfile.getName()) + ": " + ioe.getMessage()); return; } @@ -1222,21 +1222,21 @@ public class SnarkManager implements CompleteListener { Snark snark = getTorrentByInfoHash(info.getInfoHash()); if (snark != null) { // TODO - if the existing one is a magnet, delete it and add the metainfo instead? - addMessage(_("Torrent with this info hash is already running: {0}", snark.getBaseName())); + addMessage(_t("Torrent with this info hash is already running: {0}", snark.getBaseName())); return; } if (!TrackerClient.isValidAnnounce(info.getAnnounce())) { if (info.isPrivate()) { - addMessage(_("ERROR - No I2P trackers in private torrent \"{0}\"", info.getName())); + addMessage(_t("ERROR - No I2P trackers in private torrent \"{0}\"", info.getName())); } else if (!_util.getOpenTrackers().isEmpty()) { - addMessage(_("Warning - No I2P trackers in \"{0}\", will announce to I2P open trackers and DHT only.", info.getName())); - //addMessage(_("Warning - No I2P trackers in \"{0}\", will announce to I2P open trackers only.", info.getName())); + addMessage(_t("Warning - No I2P trackers in \"{0}\", will announce to I2P open trackers and DHT only.", info.getName())); + //addMessage(_t("Warning - No I2P trackers in \"{0}\", will announce to I2P open trackers only.", info.getName())); } else if (_util.shouldUseDHT()) { - addMessage(_("Warning - No I2P trackers in \"{0}\", and open trackers are disabled, will announce to DHT only.", info.getName())); + addMessage(_t("Warning - No I2P trackers in \"{0}\", and open trackers are disabled, will announce to DHT only.", info.getName())); } else { - addMessage(_("Warning - No I2P trackers in \"{0}\", and DHT and open trackers are disabled, you should enable open trackers or DHT before starting the torrent.", info.getName())); - //addMessage(_("Warning - No I2P Trackers found in \"{0}\". Make sure Open Tracker is enabled before starting this torrent.", info.getName())); + addMessage(_t("Warning - No I2P trackers in \"{0}\", and DHT and open trackers are disabled, you should enable open trackers or DHT before starting the torrent.", info.getName())); + //addMessage(_t("Warning - No I2P Trackers found in \"{0}\". Make sure Open Tracker is enabled before starting this torrent.", info.getName())); dontAutoStart = true; } } @@ -1261,20 +1261,20 @@ public class SnarkManager implements CompleteListener { } catch (IOException ioe) { // close before rename/delete for windows if (fis != null) try { fis.close(); fis = null; } catch (IOException ioe2) {} - String err = _("Torrent in \"{0}\" is invalid", sfile.toString()) + ": " + ioe.getMessage(); + String err = _t("Torrent in \"{0}\" is invalid", sfile.toString()) + ": " + ioe.getMessage(); addMessage(err); _log.error(err, ioe); File rename = new File(filename + ".BAD"); if (rename.exists()) { if (sfile.delete()) - addMessage(_("Torrent file deleted: {0}", sfile.toString())); + addMessage(_t("Torrent file deleted: {0}", sfile.toString())); } else { if (FileUtil.rename(sfile, rename)) - addMessage(_("Torrent file moved from {0} to {1}", sfile.toString(), rename.toString())); + addMessage(_t("Torrent file moved from {0} to {1}", sfile.toString(), rename.toString())); } return; } catch (OutOfMemoryError oom) { - addMessage(_("ERROR - Out of memory, cannot create torrent from {0}", sfile.getName()) + ": " + oom.getMessage()); + addMessage(_t("ERROR - Out of memory, cannot create torrent from {0}", sfile.getName()) + ": " + oom.getMessage()); return; } finally { if (fis != null) try { fis.close(); } catch (IOException ioe) {} @@ -1295,9 +1295,9 @@ public class SnarkManager implements CompleteListener { // Were we running last time? if (!dontAutoStart && shouldAutoStart() && running) { torrent.startTorrent(); - addMessage(_("Torrent added and started: \"{0}\"", torrent.getBaseName())); + addMessage(_t("Torrent added and started: \"{0}\"", torrent.getBaseName())); } else { - addMessage(_("Torrent added: \"{0}\"", torrent.getBaseName())); + addMessage(_t("Torrent added: \"{0}\"", torrent.getBaseName())); } } @@ -1362,7 +1362,7 @@ public class SnarkManager implements CompleteListener { synchronized (_snarks) { Snark snark = getTorrentByInfoHash(ih); if (snark != null) { - addMessage(_("Torrent with this info hash is already running: {0}", snark.getBaseName())); + addMessage(_t("Torrent with this info hash is already running: {0}", snark.getBaseName())); return null; } // Tell the dir monitor not to delete us @@ -1373,17 +1373,17 @@ public class SnarkManager implements CompleteListener { } if (autoStart) { startTorrent(ih); - addMessage(_("Fetching {0}", name)); + addMessage(_t("Fetching {0}", name)); DHT dht = _util.getDHT(); boolean shouldWarn = _util.connected() && _util.getOpenTrackers().isEmpty() && ((!_util.shouldUseDHT()) || dht == null || dht.size() <= 0); if (shouldWarn) { - addMessage(_("Open trackers are disabled and we have no DHT peers. " + + addMessage(_t("Open trackers are disabled and we have no DHT peers. " + "Fetch of {0} may not succeed until you start another torrent, enable open trackers, or enable DHT.", name)); } } else { - addMessage(_("Adding {0}", name)); + addMessage(_t("Adding {0}", name)); } return torrent; } @@ -1416,7 +1416,7 @@ public class SnarkManager implements CompleteListener { synchronized (_snarks) { Snark snark = getTorrentByInfoHash(torrent.getInfoHash()); if (snark != null) { - addMessage(_("Download already running: {0}", snark.getBaseName())); + addMessage(_t("Download already running: {0}", snark.getBaseName())); return; } String name = torrent.getName(); @@ -1450,7 +1450,7 @@ public class SnarkManager implements CompleteListener { synchronized (_snarks) { Snark snark = getTorrentByInfoHash(metainfo.getInfoHash()); if (snark != null) { - addMessage(_("Torrent with this info hash is already running: {0}", snark.getBaseName())); + addMessage(_t("Torrent with this info hash is already running: {0}", snark.getBaseName())); return false; } else { saveTorrentStatus(metainfo, bitfield, null, baseFile, true, 0, true); // no file priorities @@ -1461,7 +1461,7 @@ public class SnarkManager implements CompleteListener { // hold the lock for a long time addTorrent(filename, baseFile, dontAutoStart); } catch (IOException ioe) { - addMessage(_("Failed to copy torrent file to {0}", filename)); + addMessage(_t("Failed to copy torrent file to {0}", filename)); _log.error("Failed to write torrent file", ioe); return false; } @@ -1487,7 +1487,7 @@ public class SnarkManager implements CompleteListener { synchronized (_snarks) { boolean success = FileUtil.copy(fromfile.getAbsolutePath(), filename, false); if (!success) { - addMessage(_("Failed to copy torrent file to {0}", filename)); + addMessage(_t("Failed to copy torrent file to {0}", filename)); _log.error("Failed to write torrent file to " + filename); return; } @@ -1901,18 +1901,18 @@ public class SnarkManager implements CompleteListener { private String validateTorrent(MetaInfo info) { List> files = info.getFiles(); if ( (files != null) && (files.size() > MAX_FILES_PER_TORRENT) ) { - return _("Too many files in \"{0}\" ({1})!", info.getName(), files.size()); + return _t("Too many files in \"{0}\" ({1})!", info.getName(), files.size()); } else if ( (files == null) && (info.getName().endsWith(".torrent")) ) { - return _("Torrent file \"{0}\" cannot end in \".torrent\"!", info.getName()); + return _t("Torrent file \"{0}\" cannot end in \".torrent\"!", info.getName()); } else if (info.getPieces() <= 0) { - return _("No pieces in \"{0}\"!", info.getName()); + return _t("No pieces in \"{0}\"!", info.getName()); } else if (info.getPieces() > Storage.MAX_PIECES) { - return _("Too many pieces in \"{0}\", limit is {1}!", info.getName(), Storage.MAX_PIECES); + return _t("Too many pieces in \"{0}\", limit is {1}!", info.getName(), Storage.MAX_PIECES); } else if (info.getPieceLength(0) > Storage.MAX_PIECE_SIZE) { - return _("Pieces are too large in \"{0}\" ({1}B)!", info.getName(), DataHelper.formatSize2(info.getPieceLength(0))) + ' ' + - _("Limit is {0}B", DataHelper.formatSize2(Storage.MAX_PIECE_SIZE)); + return _t("Pieces are too large in \"{0}\" ({1}B)!", info.getName(), DataHelper.formatSize2(info.getPieceLength(0))) + ' ' + + _t("Limit is {0}B", DataHelper.formatSize2(Storage.MAX_PIECE_SIZE)); } else if (info.getTotalLength() <= 0) { - return _("Torrent \"{0}\" has no data!", info.getName()); + return _t("Torrent \"{0}\" has no data!", info.getName()); } else if (info.getTotalLength() > Storage.MAX_TOTAL_SIZE) { System.out.println("torrent info: " + info.toString()); List lengths = info.getLengths(); @@ -1920,7 +1920,7 @@ public class SnarkManager implements CompleteListener { for (int i = 0; i < lengths.size(); i++) System.out.println("File " + i + " is " + lengths.get(i) + " long."); - return _("Torrents larger than {0}B are not supported yet \"{1}\"!", Storage.MAX_TOTAL_SIZE, info.getName()); + return _t("Torrents larger than {0}B are not supported yet \"{1}\"!", Storage.MAX_TOTAL_SIZE, info.getName()); } else { // ok return null; @@ -1937,7 +1937,7 @@ public class SnarkManager implements CompleteListener { filename = sfile.getCanonicalPath(); } catch (IOException ioe) { _log.error("Unable to remove the torrent " + filename, ioe); - addMessage(_("Error: Could not remove the torrent {0}", filename) + ": " + ioe.getMessage()); + addMessage(_t("Error: Could not remove the torrent {0}", filename) + ": " + ioe.getMessage()); return null; } int remaining = 0; @@ -1960,7 +1960,7 @@ public class SnarkManager implements CompleteListener { if (shouldRemove) removeTorrentStatus(torrent); if (!wasStopped) - addMessage(_("Torrent stopped: \"{0}\"", torrent.getBaseName())); + addMessage(_t("Torrent stopped: \"{0}\"", torrent.getBaseName())); } return torrent; } @@ -1979,7 +1979,7 @@ public class SnarkManager implements CompleteListener { boolean wasStopped = torrent.isStopped(); torrent.stopTorrent(); if (!wasStopped) - addMessage(_("Torrent stopped: \"{0}\"", torrent.getBaseName())); + addMessage(_t("Torrent stopped: \"{0}\"", torrent.getBaseName())); if (shouldRemove) removeTorrentStatus(torrent); } @@ -1999,7 +1999,7 @@ public class SnarkManager implements CompleteListener { File torrentFile = new File(filename); torrentFile.delete(); } - addMessage(_("Torrent removed: \"{0}\"", torrent.getBaseName())); + addMessage(_t("Torrent removed: \"{0}\"", torrent.getBaseName())); } private class DirMonitor implements Runnable { @@ -2007,7 +2007,7 @@ public class SnarkManager implements CompleteListener { // don't bother delaying if auto start is false long delay = (60L * 1000) * getStartupDelayMinutes(); if (delay > 0 && shouldAutoStart()) { - addMessage(_("Adding torrents in {0}", DataHelper.formatDuration2(delay))); + addMessage(_t("Adding torrents in {0}", DataHelper.formatDuration2(delay))); try { Thread.sleep(delay); } catch (InterruptedException ie) {} // Remove that first message if (_messages.size() == 1) @@ -2041,7 +2041,7 @@ public class SnarkManager implements CompleteListener { _log.error("Error in the DirectoryMonitor", e); } if (!_snarks.isEmpty()) - addMessage(_("Up bandwidth limit is {0} KBps", _util.getMaxUpBW())); + addMessage(_t("Up bandwidth limit is {0} KBps", _util.getMaxUpBW())); // To fix bug where files were left behind, // but also good for when user removes snarks when i2p is not running // Don't run if there was an error, as we would delete the torrent config @@ -2072,7 +2072,7 @@ public class SnarkManager implements CompleteListener { buf.append('/'); buf.append("\">").append(base).append(""); if (snark.getDownloaded() > 0) - addMessageNoEscape(_("Download finished: {0}", buf.toString())); // + " (" + _("size: {0}B", DataHelper.formatSize2(len)) + ')'); + addMessageNoEscape(_t("Download finished: {0}", buf.toString())); // + " (" + _t("size: {0}B", DataHelper.formatSize2(len)) + ')'); updateStatus(snark); } @@ -2127,11 +2127,11 @@ public class SnarkManager implements CompleteListener { } _magnets.remove(snark.getName()); removeMagnetStatus(snark.getInfoHash()); - addMessage(_("Metainfo received for {0}", snark.getName())); - addMessage(_("Starting up torrent {0}", storage.getBaseName())); + addMessage(_t("Metainfo received for {0}", snark.getName())); + addMessage(_t("Starting up torrent {0}", storage.getBaseName())); return name; } catch (IOException ioe) { - addMessage(_("Failed to copy torrent file to {0}", name)); + addMessage(_t("Failed to copy torrent file to {0}", name)); _log.error("Failed to write torrent file", ioe); } } @@ -2143,7 +2143,7 @@ public class SnarkManager implements CompleteListener { * @since 0.9 */ public void fatal(Snark snark, String error) { - addMessage(_("Error on torrent {0}", snark.getName()) + ": " + error); + addMessage(_t("Error on torrent {0}", snark.getName()) + ": " + error); } /** @@ -2180,7 +2180,7 @@ public class SnarkManager implements CompleteListener { Properties config = getConfig(ih); String name = config.getProperty(PROP_META_MAGNET_DN); if (name == null) - name = _("Magnet") + ' ' + I2PSnarkUtil.toHex(ih); + name = _t("Magnet") + ' ' + I2PSnarkUtil.toHex(ih); String tracker = config.getProperty(PROP_META_MAGNET_TR); String dir = config.getProperty(PROP_META_MAGNET_DIR); File dirf = (dir != null) ? (new File(dir)) : null; @@ -2223,13 +2223,13 @@ public class SnarkManager implements CompleteListener { // already known. noop } else { if (shouldAutoStart() && !_util.connect()) - addMessage(_("Unable to connect to I2P!")); + addMessage(_t("Unable to connect to I2P!")); try { // Snark.fatal() throws a RuntimeException // don't let one bad torrent kill the whole loop addTorrent(name, null, !shouldAutoStart()); } catch (Exception e) { - addMessage(_("Error: Could not add the torrent {0}", name) + ": " + e); + addMessage(_t("Error: Could not add the torrent {0}", name) + ": " + e); _log.error("Unable to add the torrent " + name, e); rv = false; } @@ -2256,17 +2256,17 @@ public class SnarkManager implements CompleteListener { } /** translate */ - private String _(String s) { + private String _t(String s) { return _util.getString(s); } /** translate */ - private String _(String s, Object o) { + private String _t(String s, Object o) { return _util.getString(s, o); } /** translate */ - private String _(String s, Object o, Object o2) { + private String _t(String s, Object o, Object o2) { return _util.getString(s, o, o2); } @@ -2389,8 +2389,8 @@ public class SnarkManager implements CompleteListener { } boolean connected = _util.connected(); if ((!connected) && !_util.isConnecting()) - addMessage(_("Opening the I2P tunnel")); - addMessage(_("Starting up torrent {0}", snark.getBaseName())); + addMessage(_t("Opening the I2P tunnel")); + addMessage(_t("Starting up torrent {0}", snark.getBaseName())); if (connected) { snark.startTorrent(); } else { @@ -2409,7 +2409,7 @@ public class SnarkManager implements CompleteListener { if (_util.connected()) { startAll(); } else { - addMessage(_("Opening the I2P tunnel and starting all torrents.")); + addMessage(_t("Opening the I2P tunnel and starting all torrents.")); for (Snark snark : _snarks.values()) { // mark it for the UI snark.setStarting(); @@ -2472,7 +2472,7 @@ public class SnarkManager implements CompleteListener { for (Snark snark : _snarks.values()) { if (!snark.isStopped()) { if (count == 0) - addMessage(_("Stopping all torrents and closing the I2P tunnel.")); + addMessage(_t("Stopping all torrents and closing the I2P tunnel.")); count++; if (finalShutdown) snark.stopTorrent(true); @@ -2491,14 +2491,14 @@ public class SnarkManager implements CompleteListener { // Schedule this even for final shutdown, as there's a chance // that it's just this webapp that is stopping. _context.simpleTimer2().addEvent(new Disconnector(), 60*1000); - addMessage(_("Closing I2P tunnel after notifying trackers.")); + addMessage(_t("Closing I2P tunnel after notifying trackers.")); if (finalShutdown) { try { Thread.sleep(5*1000); } catch (InterruptedException ie) {} } } else { _util.disconnect(); _stopping = false; - addMessage(_("I2P tunnel closed.")); + addMessage(_t("I2P tunnel closed.")); } } } @@ -2509,7 +2509,7 @@ public class SnarkManager implements CompleteListener { if (_util.connected()) { _util.disconnect(); _stopping = false; - addMessage(_("I2P tunnel closed.")); + addMessage(_t("I2P tunnel closed.")); } } } @@ -2552,13 +2552,13 @@ public class SnarkManager implements CompleteListener { int pieces = snark.getPieces(); double completion = (pieces - snark.getNeeded()) / (double) pieces; String complete = (new DecimalFormat("0.00%")).format(completion); - addMessage(_("Finished recheck of torrent {0}, now {1} complete", snark.getBaseName(), complete)); + addMessage(_t("Finished recheck of torrent {0}, now {1} complete", snark.getBaseName(), complete)); } else { - addMessage(_("Finished recheck of torrent {0}, unchanged", snark.getBaseName())); + addMessage(_t("Finished recheck of torrent {0}, unchanged", snark.getBaseName())); } } catch (Exception e) { _log.error("Error rechecking " + snark.getBaseName(), e); - addMessage(_("Error checking the torrent {0}", snark.getBaseName()) + ": " + e); + addMessage(_t("Error checking the torrent {0}", snark.getBaseName()) + ": " + e); } } } diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/FetchAndAdd.java b/apps/i2psnark/java/src/org/klomp/snark/web/FetchAndAdd.java index 99e2f62a69..5537b33f14 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/FetchAndAdd.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/FetchAndAdd.java @@ -77,7 +77,7 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl _log = ctx.logManager().getLog(FetchAndAdd.class); _mgr = mgr; _url = url; - _name = _("Download torrent file from {0}", url); + _name = _t("Download torrent file from {0}", url); _dataDir = dataDir; byte[] fake = null; try { @@ -90,7 +90,7 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl * Set off by startTorrent() */ public void run() { - _mgr.addMessageNoEscape(_("Fetching {0}", urlify(_url))); + _mgr.addMessageNoEscape(_t("Fetching {0}", urlify(_url))); File file = get(); if (!_isRunning) // stopped? return; @@ -100,7 +100,7 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl _mgr.deleteMagnet(this); add(file); } else { - _mgr.addMessageNoEscape(_("Torrent was not retrieved from {0}", urlify(_url)) + + _mgr.addMessageNoEscape(_t("Torrent was not retrieved from {0}", urlify(_url)) + ((_failCause != null) ? (": " + DataHelper.stripHTML(_failCause)) : "")); } if (file != null) @@ -127,7 +127,7 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl out.deleteOnExit(); if (!_mgr.util().connected()) { - _mgr.addMessage(_("Opening the I2P tunnel")); + _mgr.addMessage(_t("Opening the I2P tunnel")); if (!_mgr.util().connect()) return null; } @@ -154,7 +154,7 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl * This Snark may then be deleted. */ private void add(File file) { - _mgr.addMessageNoEscape(_("Torrent fetched from {0}", urlify(_url))); + _mgr.addMessageNoEscape(_t("Torrent fetched from {0}", urlify(_url))); FileInputStream in = null; try { in = new FileInputStream(file); @@ -163,7 +163,7 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl try { in.close(); } catch (IOException ioe) {} Snark snark = _mgr.getTorrentByInfoHash(fileInfoHash); if (snark != null) { - _mgr.addMessage(_("Torrent with this info hash is already running: {0}", snark.getBaseName())); + _mgr.addMessage(_t("Torrent with this info hash is already running: {0}", snark.getBaseName())); return; } @@ -175,9 +175,9 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl if (torrentFile.exists()) { if (_mgr.getTorrent(canonical) != null) - _mgr.addMessage(_("Torrent already running: {0}", name)); + _mgr.addMessage(_t("Torrent already running: {0}", name)); else - _mgr.addMessage(_("Torrent already in the queue: {0}", name)); + _mgr.addMessage(_t("Torrent already in the queue: {0}", name)); } else { // This may take a LONG time to create the storage. _mgr.copyAndAddTorrent(file, canonical, _dataDir); @@ -188,9 +188,9 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl throw new IOException("Unknown error - check logs"); } } catch (IOException ioe) { - _mgr.addMessageNoEscape(_("Torrent at {0} was not valid", urlify(_url)) + ": " + DataHelper.stripHTML(ioe.getMessage())); + _mgr.addMessageNoEscape(_t("Torrent at {0} was not valid", urlify(_url)) + ": " + DataHelper.stripHTML(ioe.getMessage())); } catch (OutOfMemoryError oom) { - _mgr.addMessageNoEscape(_("ERROR - Out of memory, cannot create torrent from {0}", urlify(_url)) + ": " + DataHelper.stripHTML(oom.getMessage())); + _mgr.addMessageNoEscape(_t("ERROR - Out of memory, cannot create torrent from {0}", urlify(_url)) + ": " + DataHelper.stripHTML(oom.getMessage())); } finally { try { if (in != null) in.close(); } catch (IOException ioe) {} } @@ -345,11 +345,11 @@ public class FetchAndAdd extends Snark implements EepGet.StatusListener, Runnabl // End of EepGet status listeners - private String _(String s) { + private String _t(String s) { return _mgr.util().getString(s); } - private String _(String s, String o) { + private String _t(String s, String o) { return _mgr.util().getString(s, o); } diff --git a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java index 08ea4c24ff..72ea2ecadf 100644 --- a/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java +++ b/apps/i2psnark/java/src/org/klomp/snark/web/I2PSnarkServlet.java @@ -266,14 +266,14 @@ public class I2PSnarkServlet extends BasicServlet { "\n" + ""); if (_contextName.equals(DEFAULT_NAME)) - out.write(_("I2PSnark")); + out.write(_t("I2PSnark")); else out.write(_contextName); out.write(" - "); if (isConfigure) - out.write(_("Configuration")); + out.write(_t("Configuration")); else - out.write(_("Anonymous BitTorrent Client")); + out.write(_t("Anonymous BitTorrent Client")); String peerParam = req.getParameter("p"); if ("2".equals(peerParam)) out.write(" | Debug Mode"); @@ -287,7 +287,7 @@ public class I2PSnarkServlet extends BasicServlet { //out.write("<meta http-equiv=\"refresh\" content=\"" + delay + ";/i2psnark/" + peerString + "\">\n"); out.write("<script src=\"/js/ajax.js\" type=\"text/javascript\"></script>\n" + "<script type=\"text/javascript\">\n" + - "var failMessage = \"<div class=\\\"routerdown\\\"><b>" + _("Router is down") + "<\\/b><\\/div>\";\n" + + "var failMessage = \"<div class=\\\"routerdown\\\"><b>" + _t("Router is down") + "<\\/b><\\/div>\";\n" + "function requestAjax1() { ajax(\"" + _contextPath + "/.ajax/xhr1.html" + peerString.replace("&", "&") + // don't html escape in js "\", \"mainsection\", " + (delay*1000) + "); }\n" + @@ -304,27 +304,27 @@ public class I2PSnarkServlet extends BasicServlet { List<Tracker> sortedTrackers = null; if (isConfigure) { out.write("<div class=\"snarknavbar\"><a href=\"" + _contextPath + "/\" title=\""); - out.write(_("Torrents")); + out.write(_t("Torrents")); out.write("\" class=\"snarkRefresh\">"); out.write(toThemeImg("arrow_refresh")); out.write("  "); if (_contextName.equals(DEFAULT_NAME)) - out.write(_("I2PSnark")); + out.write(_t("I2PSnark")); else out.write(_contextName); out.write("</a>"); } else { out.write("<div class=\"snarknavbar\"><a href=\"" + _contextPath + '/' + peerString + "\" title=\""); - out.write(_("Refresh page")); + out.write(_t("Refresh page")); out.write("\" class=\"snarkRefresh\">"); out.write(toThemeImg("arrow_refresh")); out.write("  "); if (_contextName.equals(DEFAULT_NAME)) - out.write(_("I2PSnark")); + out.write(_t("I2PSnark")); else out.write(_contextName); out.write("</a> <a href=\"http://forum.i2p/viewforum.php?f=21\" class=\"snarkRefresh\" target=\"_blank\">"); - out.write(_("Forum")); + out.write(_t("Forum")); out.write("</a>\n"); sortedTrackers = _manager.getSortedTrackers(); @@ -339,7 +339,7 @@ public class I2PSnarkServlet extends BasicServlet { out.write("</div>\n"); String newURL = req.getParameter("newURL"); if (newURL != null && newURL.trim().length() > 0 && req.getMethod().equals("GET")) - _manager.addMessage(_("Click \"Add torrent\" button to fetch torrent")); + _manager.addMessage(_t("Click \"Add torrent\" button to fetch torrent")); out.write("<div class=\"page\"><div id=\"mainsection\" class=\"mainsection\">"); writeMessages(out, isConfigure, peerString); @@ -392,7 +392,7 @@ public class I2PSnarkServlet extends BasicServlet { else out.write("?"); out.write("action=Clear&nonce=" + _nonce + "\">"); - String tx = _("clear messages"); + String tx = _t("clear messages"); out.write(toThemeImg("delete", tx, tx)); out.write("</a>" + "<ul>"); @@ -447,9 +447,9 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<a href=\"" + _contextPath + '/' + getQueryString(req, null, null, sort)); out.write("\">"); } - String tx = _("Status"); + String tx = _t("Status"); out.write(toThemeImg("status", tx, - showSort ? _("Sort by {0}", tx) + showSort ? _t("Sort by {0}", tx) : tx)); if (showSort) out.write("</a>"); @@ -460,13 +460,13 @@ public class I2PSnarkServlet extends BasicServlet { // disable peer view out.write(getQueryString(req, "", null, null)); out.write("\">"); - tx = _("Hide Peers"); + tx = _t("Hide Peers"); out.write(toThemeImg("hidepeers", tx, tx)); } else { // enable peer view out.write(getQueryString(req, "1", null, null)); out.write("\">"); - tx = _("Show Peers"); + tx = _t("Show Peers"); out.write(toThemeImg("showpeers", tx, tx)); } out.write("</a><br>\n"); @@ -489,9 +489,9 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<a href=\"" + _contextPath + '/' + getQueryString(req, null, null, sort)); out.write("\">"); } - tx = _("Torrent"); + tx = _t("Torrent"); out.write(toThemeImg("torrent", tx, - showSort ? _("Sort by {0}", (isTypeSort ? _("File type") : tx)) + showSort ? _t("Sort by {0}", (isTypeSort ? _t("File type") : tx)) : tx)); if (showSort) out.write("</a>"); @@ -507,10 +507,10 @@ public class I2PSnarkServlet extends BasicServlet { out.write("\">"); } // Translators: Please keep short or translate as " " - tx = _("ETA"); + tx = _t("ETA"); out.write(toThemeImg("eta", tx, - showSort ? _("Sort by {0}", _("Estimated time remaining")) - : _("Estimated time remaining"))); + showSort ? _t("Sort by {0}", _t("Estimated time remaining")) + : _t("Estimated time remaining"))); if (showSort) out.write("</a>"); } @@ -533,10 +533,10 @@ public class I2PSnarkServlet extends BasicServlet { out.write("\">"); } // Translators: Please keep short or translate as " " - tx = _("RX"); + tx = _t("RX"); out.write(toThemeImg("head_rx", tx, - showSort ? _("Sort by {0}", (isDlSort ? _("Downloaded") : _("Size"))) - : _("Downloaded"))); + showSort ? _t("Sort by {0}", (isDlSort ? _t("Downloaded") : _t("Size"))) + : _t("Downloaded"))); if (showSort) out.write("</a>"); out.write("</th>\n<th align=\"right\">"); @@ -564,10 +564,10 @@ public class I2PSnarkServlet extends BasicServlet { out.write("\">"); } // Translators: Please keep short or translate as " " - tx = _("TX"); + tx = _t("TX"); out.write(toThemeImg("head_tx", tx, - showSort ? _("Sort by {0}", (nextRatSort ? _("Upload ratio") : _("Uploaded"))) - : _("Uploaded"))); + showSort ? _t("Sort by {0}", (nextRatSort ? _t("Upload ratio") : _t("Uploaded"))) + : _t("Uploaded"))); if (showSort) out.write("</a>"); } @@ -579,10 +579,10 @@ public class I2PSnarkServlet extends BasicServlet { out.write("\">"); } // Translators: Please keep short or translate as " " - tx = _("RX Rate"); + tx = _t("RX Rate"); out.write(toThemeImg("head_rxspeed", tx, - showSort ? _("Sort by {0}", _("Down Rate")) - : _("Down Rate"))); + showSort ? _t("Sort by {0}", _t("Down Rate")) + : _t("Down Rate"))); if (showSort) out.write("</a>"); } @@ -594,10 +594,10 @@ public class I2PSnarkServlet extends BasicServlet { out.write("\">"); } // Translators: Please keep short or translate as " " - tx = _("TX Rate"); + tx = _t("TX Rate"); out.write(toThemeImg("head_txspeed", tx, - showSort ? _("Sort by {0}", _("Up Rate")) - : _("Up Rate"))); + showSort ? _t("Sort by {0}", _t("Up Rate")) + : _t("Up Rate"))); if (showSort) out.write("</a>"); } @@ -613,9 +613,9 @@ public class I2PSnarkServlet extends BasicServlet { //out.write("<input type=\"image\" name=\"action\" value=\"StopAll\" title=\""); out.write("<input type=\"image\" name=\"action_StopAll\" value=\"foo\" title=\""); } - out.write(_("Stop all torrents and the I2P tunnel")); + out.write(_t("Stop all torrents and the I2P tunnel")); out.write("\" src=\"" + _imgPath + "stop_all.png\" alt=\""); - out.write(_("Stop All")); + out.write(_t("Stop All")); out.write("\">"); if (isDegraded) out.write("</a>"); @@ -627,9 +627,9 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<a href=\"" + _contextPath + "/?action=StartAll&nonce=" + _nonce + "\"><img title=\""); else out.write("<input type=\"image\" name=\"action_StartAll\" value=\"foo\" title=\""); - out.write(_("Start all stopped torrents")); + out.write(_t("Start all stopped torrents")); out.write("\" src=\"" + _imgPath + "start_all.png\" alt=\""); - out.write(_("Start All")); + out.write(_t("Start All")); out.write("\">"); if (isDegraded) out.write("</a>"); @@ -641,9 +641,9 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<a href=\"" + _contextPath + "/?action=StartAll&nonce=" + _nonce + "\"><img title=\""); else out.write("<input type=\"image\" name=\"action_StartAll\" value=\"foo\" title=\""); - out.write(_("Start all torrents and the I2P tunnel")); + out.write(_t("Start all torrents and the I2P tunnel")); out.write("\" src=\"" + _imgPath + "start_all.png\" alt=\""); - out.write(_("Start All")); + out.write(_t("Start All")); out.write("\">"); if (isDegraded) out.write("</a>"); @@ -666,13 +666,13 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<tr class=\"snarkTorrentNoneLoaded\">" + "<td class=\"snarkTorrentNoneLoaded\"" + " colspan=\"11\"><i>"); - out.write(_("No torrents loaded.")); + out.write(_t("No torrents loaded.")); out.write("</i></td></tr>\n"); } else /** if (snarks.size() > 1) */ { out.write("<tfoot><tr>\n" + " <th align=\"left\" colspan=\"6\">"); out.write(" "); - out.write(_("Totals")); + out.write(_t("Totals")); out.write(": "); out.write(ngettext("1 torrent", "{0} torrents", total)); out.write(", "); @@ -693,7 +693,7 @@ public class I2PSnarkServlet extends BasicServlet { if(!IPString.equals("unknown")) { // Only truncate if it's an actual dest out.write("; "); - out.write(_("Dest")); + out.write(_t("Dest")); out.write(": <tt>"); out.write(IPString.substring(0, 4)); out.write("</tt>"); @@ -821,7 +821,7 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<a href=\"" + _contextPath); out.write(getQueryString(req, null, "", null)); out.write("\">"); - out.write(toThemeImg("control_rewind_blue", _("First"), _("First page"))); + out.write(toThemeImg("control_rewind_blue", _t("First"), _t("First page"))); out.write("</a> "); int prev = Math.max(0, start - pageSize); //if (prev > 0) { @@ -831,7 +831,7 @@ public class I2PSnarkServlet extends BasicServlet { String sprev = (prev > 0) ? Integer.toString(prev) : ""; out.write(getQueryString(req, null, sprev, null)); out.write("\">"); - out.write(toThemeImg("control_back_blue", _("Prev"), _("Previous page"))); + out.write(toThemeImg("control_back_blue", _t("Prev"), _t("Previous page"))); out.write("</a> "); } } else { @@ -853,7 +853,7 @@ public class I2PSnarkServlet extends BasicServlet { page = pages; else page = 1 + (start / pageSize); - //out.write(" " + _("Page {0}", page) + thinsp(noThinsp) + pages + " "); + //out.write(" " + _t("Page {0}", page) + thinsp(noThinsp) + pages + " "); out.write("  " + page + thinsp(noThinsp) + pages + "  "); } if (start + pageSize < total) { @@ -864,7 +864,7 @@ public class I2PSnarkServlet extends BasicServlet { out.write(" <a href=\"" + _contextPath); out.write(getQueryString(req, null, Integer.toString(next), null)); out.write("\">"); - out.write(toThemeImg("control_play_blue", _("Next"), _("Next page"))); + out.write(toThemeImg("control_play_blue", _t("Next"), _t("Next page"))); out.write("</a> "); } // Last @@ -872,7 +872,7 @@ public class I2PSnarkServlet extends BasicServlet { out.write(" <a href=\"" + _contextPath); out.write(getQueryString(req, null, Integer.toString(last), null)); out.write("\">"); - out.write(toThemeImg("control_fastforward_blue", _("Last"), _("Last page"))); + out.write(toThemeImg("control_fastforward_blue", _t("Last"), _t("Last page"))); out.write("</a> "); } else { out.write(" " + @@ -918,7 +918,7 @@ public class I2PSnarkServlet extends BasicServlet { if ( (newFile != null) && (newFile.trim().length() > 0) ) f = new File(newFile.trim()); if ( (f != null) && (!f.exists()) ) { - _manager.addMessage(_("Torrent file {0} does not exist", newFile)); + _manager.addMessage(_t("Torrent file {0} does not exist", newFile)); } if ( (f != null) && (f.exists()) ) { // NOTE - All this is disabled - load from local file disabled @@ -929,16 +929,16 @@ public class I2PSnarkServlet extends BasicServlet { if (local.exists()) { if (_manager.getTorrent(canonical) != null) - _manager.addMessage(_("Torrent already running: {0}", newFile)); + _manager.addMessage(_t("Torrent already running: {0}", newFile)); else - _manager.addMessage(_("Torrent already in the queue: {0}", newFile)); + _manager.addMessage(_t("Torrent already in the queue: {0}", newFile)); } else { boolean ok = FileUtil.copy(f.getAbsolutePath(), local.getAbsolutePath(), true); if (ok) { - _manager.addMessage(_("Copying torrent to {0}", local.getAbsolutePath())); + _manager.addMessage(_t("Copying torrent to {0}", local.getAbsolutePath())); _manager.addTorrent(canonical); } else { - _manager.addMessage(_("Unable to copy the torrent to {0}", local.getAbsolutePath()) + ' ' + _("from {0}", f.getAbsolutePath())); + _manager.addMessage(_t("Unable to copy the torrent to {0}", local.getAbsolutePath()) + ' ' + _t("from {0}", f.getAbsolutePath())); } } } catch (IOException ioe) { @@ -954,11 +954,11 @@ public class I2PSnarkServlet extends BasicServlet { if (newDir.length() > 0) { dir = new SecureFile(newDir); if (!dir.isAbsolute()) { - _manager.addMessage(_("Data directory must be an absolute path") + ": " + dir); + _manager.addMessage(_t("Data directory must be an absolute path") + ": " + dir); return; } if (!dir.isDirectory() && !dir.mkdirs()) { - _manager.addMessage(_("Data directory cannot be created") + ": " + dir); + _manager.addMessage(_t("Data directory cannot be created") + ": " + dir); return; } Collection<Snark> snarks = _manager.getTorrents(); @@ -968,7 +968,7 @@ public class I2PSnarkServlet extends BasicServlet { continue; File sbase = storage.getBase(); if (isParentOf(sbase, dir)) { - _manager.addMessage(_("Cannot add torrent {0} inside another torrent: {1}", + _manager.addMessage(_t("Cannot add torrent {0} inside another torrent: {1}", dir.getAbsolutePath(), sbase)); return; } @@ -983,7 +983,7 @@ public class I2PSnarkServlet extends BasicServlet { } else if (newURL.length() == 40 && newURL.replaceAll("[a-fA-F0-9]", "").length() == 0) { addMagnet(MagnetURI.MAGNET_FULL + newURL, dir); } else { - _manager.addMessage(_("Invalid URL: Must start with \"http://\", \"{0}\", or \"{1}\"", + _manager.addMessage(_t("Invalid URL: Must start with \"http://\", \"{0}\", or \"{1}\"", MagnetURI.MAGNET, MagnetURI.MAGGOT)); } } else { @@ -1024,7 +1024,7 @@ public class I2PSnarkServlet extends BasicServlet { // magnet - remove and delete are the same thing // Remove not shown on UI so we shouldn't get here _manager.deleteMagnet(snark); - _manager.addMessage(_("Magnet deleted: {0}", name)); + _manager.addMessage(_t("Magnet deleted: {0}", name)); return; } _manager.stopTorrent(snark, true); @@ -1032,7 +1032,7 @@ public class I2PSnarkServlet extends BasicServlet { // yeah, need to, otherwise it'll get autoadded again (at the moment File f = new File(name); f.delete(); - _manager.addMessage(_("Torrent file deleted: {0}", f.getAbsolutePath())); + _manager.addMessage(_t("Torrent file deleted: {0}", f.getAbsolutePath())); break; } } @@ -1051,15 +1051,15 @@ public class I2PSnarkServlet extends BasicServlet { // magnet - remove and delete are the same thing _manager.deleteMagnet(snark); if (snark instanceof FetchAndAdd) - _manager.addMessage(_("Download deleted: {0}", name)); + _manager.addMessage(_t("Download deleted: {0}", name)); else - _manager.addMessage(_("Magnet deleted: {0}", name)); + _manager.addMessage(_t("Magnet deleted: {0}", name)); return; } _manager.stopTorrent(snark, true); File f = new File(name); f.delete(); - _manager.addMessage(_("Torrent file deleted: {0}", f.getAbsolutePath())); + _manager.addMessage(_t("Torrent file deleted: {0}", f.getAbsolutePath())); Storage storage = snark.getStorage(); if (storage == null) break; @@ -1068,18 +1068,18 @@ public class I2PSnarkServlet extends BasicServlet { for (File df : storage.getFiles()) { // should be only one if (df.delete()) - _manager.addMessage(_("Data file deleted: {0}", df.getAbsolutePath())); + _manager.addMessage(_t("Data file deleted: {0}", df.getAbsolutePath())); else - _manager.addMessage(_("Data file could not be deleted: {0}", df.getAbsolutePath())); + _manager.addMessage(_t("Data file could not be deleted: {0}", df.getAbsolutePath())); } break; } // step 1 delete files for (File df : storage.getFiles()) { if (df.delete()) { - //_manager.addMessage(_("Data file deleted: {0}", df.getAbsolutePath())); + //_manager.addMessage(_t("Data file deleted: {0}", df.getAbsolutePath())); } else { - _manager.addMessage(_("Data file could not be deleted: {0}", df.getAbsolutePath())); + _manager.addMessage(_t("Data file could not be deleted: {0}", df.getAbsolutePath())); } } // step 2 delete dirs bottom-up @@ -1092,17 +1092,17 @@ public class I2PSnarkServlet extends BasicServlet { for (File df : dirs) { if (df.delete()) { ok = true; - //_manager.addMessage(_("Data dir deleted: {0}", df.getAbsolutePath())); + //_manager.addMessage(_t("Data dir deleted: {0}", df.getAbsolutePath())); } else { ok = false; - _manager.addMessage(_("Directory could not be deleted: {0}", df.getAbsolutePath())); + _manager.addMessage(_t("Directory could not be deleted: {0}", df.getAbsolutePath())); if (_log.shouldLog(Log.WARN)) _log.warn("Could not delete dir " + df); } } // step 3 message for base (last one) if (ok) - _manager.addMessage(_("Directory deleted: {0}", storage.getBase())); + _manager.addMessage(_t("Directory deleted: {0}", storage.getBase())); break; } } @@ -1153,18 +1153,18 @@ public class I2PSnarkServlet extends BasicServlet { if (baseFile.exists()) { String torrentName = baseFile.getName(); if (torrentName.toLowerCase(Locale.US).endsWith(".torrent")) { - _manager.addMessage(_("Cannot add a torrent ending in \".torrent\": {0}", baseFile.getAbsolutePath())); + _manager.addMessage(_t("Cannot add a torrent ending in \".torrent\": {0}", baseFile.getAbsolutePath())); return; } Snark snark = _manager.getTorrentByBaseName(torrentName); if (snark != null) { - _manager.addMessage(_("Torrent with this name is already running: {0}", torrentName)); + _manager.addMessage(_t("Torrent with this name is already running: {0}", torrentName)); return; } if (isParentOf(baseFile,_manager.getDataDir()) || isParentOf(baseFile, _manager.util().getContext().getBaseDir()) || isParentOf(baseFile, _manager.util().getContext().getConfigDir())) { - _manager.addMessage(_("Cannot add a torrent including an I2P directory: {0}", baseFile.getAbsolutePath())); + _manager.addMessage(_t("Cannot add a torrent including an I2P directory: {0}", baseFile.getAbsolutePath())); return; } Collection<Snark> snarks = _manager.getTorrents(); @@ -1174,12 +1174,12 @@ public class I2PSnarkServlet extends BasicServlet { continue; File sbase = storage.getBase(); if (isParentOf(sbase, baseFile)) { - _manager.addMessage(_("Cannot add torrent {0} inside another torrent: {1}", + _manager.addMessage(_t("Cannot add torrent {0} inside another torrent: {1}", baseFile.getAbsolutePath(), sbase)); return; } if (isParentOf(baseFile, sbase)) { - _manager.addMessage(_("Cannot add torrent {0} including another torrent: {1}", + _manager.addMessage(_t("Cannot add torrent {0} including another torrent: {1}", baseFile.getAbsolutePath(), sbase)); return; } @@ -1205,7 +1205,7 @@ public class I2PSnarkServlet extends BasicServlet { if (!backupURLs.isEmpty()) { // BEP 12 - Put primary first, then the others, each as the sole entry in their own list if (announceURL == null) { - _manager.addMessage(_("Error - Cannot include alternate trackers without a primary tracker")); + _manager.addMessage(_t("Error - Cannot include alternate trackers without a primary tracker")); return; } backupURLs.add(0, announceURL); @@ -1218,7 +1218,7 @@ public class I2PSnarkServlet extends BasicServlet { hasPublic = true; } if (hasPrivate && hasPublic) { - _manager.addMessage(_("Error - Cannot mix private and public trackers in a torrent")); + _manager.addMessage(_t("Error - Cannot mix private and public trackers in a torrent")); return; } announceList = new ArrayList<List<String>>(backupURLs.size()); @@ -1240,18 +1240,18 @@ public class I2PSnarkServlet extends BasicServlet { boolean ok = _manager.addTorrent(info, s.getBitField(), torrentFile.getAbsolutePath(), baseFile, true); if (!ok) return; - _manager.addMessage(_("Torrent created for \"{0}\"", baseFile.getName()) + ": " + torrentFile.getAbsolutePath()); + _manager.addMessage(_t("Torrent created for \"{0}\"", baseFile.getName()) + ": " + torrentFile.getAbsolutePath()); if (announceURL != null && !_manager.util().getOpenTrackers().contains(announceURL)) - _manager.addMessage(_("Many I2P trackers require you to register new torrents before seeding - please do so before starting \"{0}\"", baseFile.getName())); + _manager.addMessage(_t("Many I2P trackers require you to register new torrents before seeding - please do so before starting \"{0}\"", baseFile.getName())); } catch (IOException ioe) { - _manager.addMessage(_("Error creating a torrent for \"{0}\"", baseFile.getAbsolutePath()) + ": " + ioe); + _manager.addMessage(_t("Error creating a torrent for \"{0}\"", baseFile.getAbsolutePath()) + ": " + ioe); _log.error("Error creating a torrent", ioe); } } else { - _manager.addMessage(_("Cannot create a torrent for the nonexistent data: {0}", baseFile.getAbsolutePath())); + _manager.addMessage(_t("Cannot create a torrent for the nonexistent data: {0}", baseFile.getAbsolutePath())); } } else { - _manager.addMessage(_("Error creating torrent - you must enter a file or directory")); + _manager.addMessage(_t("Error creating torrent - you must enter a file or directory")); } } else if ("StopAll".equals(action)) { _manager.stopAllTorrents(false); @@ -1282,7 +1282,7 @@ public class I2PSnarkServlet extends BasicServlet { /** @since 0.9 */ private void processTrackerForm(String action, HttpServletRequest req) { - if (action.equals(_("Delete selected")) || action.equals(_("Save tracker configuration"))) { + if (action.equals(_t("Delete selected")) || action.equals(_t("Save tracker configuration"))) { boolean changed = false; Map<String, Tracker> trackers = _manager.getTrackerMap(); List<String> removed = new ArrayList<String>(); @@ -1299,7 +1299,7 @@ public class I2PSnarkServlet extends BasicServlet { Tracker t; if ((t = trackers.remove(k)) != null) { removed.add(t.announceURL); - _manager.addMessage(_("Removed") + ": " + DataHelper.stripHTML(k)); + _manager.addMessage(_t("Removed") + ": " + DataHelper.stripHTML(k)); changed = true; } } else if (k.startsWith("ttype_")) { @@ -1331,7 +1331,7 @@ public class I2PSnarkServlet extends BasicServlet { if (!priv.equals(oldPriv)) _manager.savePrivateTrackers(priv); - } else if (action.equals(_("Add tracker"))) { + } else if (action.equals(_t("Add tracker"))) { String name = req.getParameter("tname"); String hurl = req.getParameter("thurl"); String aurl = req.getParameter("taurl"); @@ -1354,15 +1354,15 @@ public class I2PSnarkServlet extends BasicServlet { _manager.savePrivateTrackers(newPriv); } } else { - _manager.addMessage(_("Enter valid tracker name and URLs")); + _manager.addMessage(_t("Enter valid tracker name and URLs")); } } else { - _manager.addMessage(_("Enter valid tracker name and URLs")); + _manager.addMessage(_t("Enter valid tracker name and URLs")); } - } else if (action.equals(_("Restore defaults"))) { + } else if (action.equals(_t("Restore defaults"))) { _manager.setDefaultTrackerMap(); _manager.saveOpenTrackers(null); - _manager.addMessage(_("Restored default trackers")); + _manager.addMessage(_t("Restored default trackers")); } else { _manager.addMessage("Unknown POST action: \"" + action + '\"'); } @@ -1470,12 +1470,12 @@ public class I2PSnarkServlet extends BasicServlet { String rowClass = (row % 2 == 0 ? "snarkTorrentEven" : "snarkTorrentOdd"); String statusString; if (snark.isChecking()) { - statusString = toThemeImg("stalled", "", _("Checking")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("Checking") + ' ' + + statusString = toThemeImg("stalled", "", _t("Checking")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("Checking") + ' ' + (new DecimalFormat("0.00%")).format(snark.getCheckingProgress()); } else if (snark.isAllocating()) { - statusString = toThemeImg("stalled", "", _("Allocating")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("Allocating"); + statusString = toThemeImg("stalled", "", _t("Allocating")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("Allocating"); } else if (err != null && isRunning && curPeers == 0) { //} else if (err != null && curPeers == 0) { // Also don't show if seeding... but then we won't see the not-registered error @@ -1483,14 +1483,14 @@ public class I2PSnarkServlet extends BasicServlet { // let's only show this if we have no peers, otherwise PEX and DHT should bail us out, user doesn't care //if (isRunning && curPeers > 0 && !showPeers) // statusString = "<img alt=\"\" border=\"0\" src=\"" + _imgPath + "trackererror.png\" title=\"" + err + "\"></td>" + - // "<td class=\"snarkTorrentStatus " + rowClass + "\">" + _("Tracker Error") + + // "<td class=\"snarkTorrentStatus " + rowClass + "\">" + _t("Tracker Error") + // ": <a href=\"" + uri + "?p=" + Base64.encode(snark.getInfoHash()) + "\">" + // curPeers + thinsp(noThinsp) + // ngettext("1 peer", "{0} peers", knownPeers) + "</a>"; //else if (isRunning) //if (isRunning) { statusString = toThemeImg("trackererror", "", err) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("Tracker Error") + + "<td class=\"snarkTorrentStatus\">" + _t("Tracker Error") + ": " + curPeers + thinsp(noThinsp) + ngettext("1 peer", "{0} peers", knownPeers); //} else { @@ -1499,11 +1499,11 @@ public class I2PSnarkServlet extends BasicServlet { // else // err = DataHelper.escapeHTML(err); // statusString = toThemeImg("trackererror", "", err) + "</td>" + - // "<td class=\"snarkTorrentStatus\">" + _("Tracker Error"); + // "<td class=\"snarkTorrentStatus\">" + _t("Tracker Error"); //} } else if (snark.isStarting()) { - statusString = toThemeImg("stalled", "", _("Starting")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("Starting"); + statusString = toThemeImg("stalled", "", _t("Starting")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("Starting"); } else if (remaining == 0 || needed == 0) { // < 0 means no meta size yet // partial complete or seeding if (isRunning) { @@ -1511,11 +1511,11 @@ public class I2PSnarkServlet extends BasicServlet { String txt; if (remaining == 0) { img = "seeding"; - txt = _("Seeding"); + txt = _t("Seeding"); } else { // partial img = "complete"; - txt = _("Complete"); + txt = _t("Complete"); } if (curPeers > 0 && !showPeers) statusString = toThemeImg(img, "", txt) + "</td>" + @@ -1529,42 +1529,42 @@ public class I2PSnarkServlet extends BasicServlet { ": " + curPeers + thinsp(noThinsp) + ngettext("1 peer", "{0} peers", knownPeers); } else { - statusString = toThemeImg("complete", "", _("Complete")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("Complete"); + statusString = toThemeImg("complete", "", _t("Complete")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("Complete"); } } else { if (isRunning && curPeers > 0 && downBps > 0 && !showPeers) - statusString = toThemeImg("downloading", "", _("OK")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("OK") + + statusString = toThemeImg("downloading", "", _t("OK")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("OK") + ": <a href=\"" + uri + getQueryString(req, Base64.encode(snark.getInfoHash()), null, null) + "\">" + curPeers + thinsp(noThinsp) + ngettext("1 peer", "{0} peers", knownPeers) + "</a>"; else if (isRunning && curPeers > 0 && downBps > 0) - statusString = toThemeImg("downloading", "", _("OK")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("OK") + + statusString = toThemeImg("downloading", "", _t("OK")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("OK") + ": " + curPeers + thinsp(noThinsp) + ngettext("1 peer", "{0} peers", knownPeers); else if (isRunning && curPeers > 0 && !showPeers) - statusString = toThemeImg("stalled", "", _("Stalled")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("Stalled") + + statusString = toThemeImg("stalled", "", _t("Stalled")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("Stalled") + ": <a href=\"" + uri + getQueryString(req, Base64.encode(snark.getInfoHash()), null, null) + "\">" + curPeers + thinsp(noThinsp) + ngettext("1 peer", "{0} peers", knownPeers) + "</a>"; else if (isRunning && curPeers > 0) - statusString = toThemeImg("stalled", "", _("Stalled")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("Stalled") + + statusString = toThemeImg("stalled", "", _t("Stalled")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("Stalled") + ": " + curPeers + thinsp(noThinsp) + ngettext("1 peer", "{0} peers", knownPeers); else if (isRunning && knownPeers > 0) - statusString = toThemeImg("nopeers", "", _("No Peers")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("No Peers") + + statusString = toThemeImg("nopeers", "", _t("No Peers")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("No Peers") + ": 0" + thinsp(noThinsp) + knownPeers ; else if (isRunning) - statusString = toThemeImg("nopeers", "", _("No Peers")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("No Peers"); + statusString = toThemeImg("nopeers", "", _t("No Peers")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("No Peers"); else - statusString = toThemeImg("stopped", "", _("Stopped")) + "</td>" + - "<td class=\"snarkTorrentStatus\">" + _("Stopped"); + statusString = toThemeImg("stopped", "", _t("Stopped")) + "</td>" + + "<td class=\"snarkTorrentStatus\">" + _t("Stopped"); } out.write("<tr class=\"" + rowClass + "\">"); @@ -1593,7 +1593,7 @@ public class I2PSnarkServlet extends BasicServlet { // gets us to the details page instead of the file. StringBuilder buf = new StringBuilder(128); buf.append("<a href=\"").append(encodedBaseName) - .append("/\" title=\"").append(_("Torrent details")) + .append("/\" title=\"").append(_t("Torrent details")) .append("\">"); out.write(buf.toString()); } @@ -1628,9 +1628,9 @@ public class I2PSnarkServlet extends BasicServlet { buf.append('/'); buf.append("\" title=\""); if (isMultiFile) - buf.append(_("View files")); + buf.append(_t("View files")); else - buf.append(_("Open file")); + buf.append(_t("Open file")); buf.append("\">"); out.write(buf.toString()); } @@ -1682,9 +1682,9 @@ public class I2PSnarkServlet extends BasicServlet { getQueryString(req, "", null, null).replace("?", "&") + "\"><img title=\""); else out.write("<input type=\"image\" name=\"action_Stop_" + b64 + "\" value=\"foo\" title=\""); - out.write(_("Stop the torrent")); + out.write(_t("Stop the torrent")); out.write("\" src=\"" + _imgPath + "stop.png\" alt=\""); - out.write(_("Stop")); + out.write(_t("Stop")); out.write("\">"); if (isDegraded) out.write("</a>"); @@ -1697,9 +1697,9 @@ public class I2PSnarkServlet extends BasicServlet { getQueryString(req, "", null, null).replace("?", "&") + "\"><img title=\""); else out.write("<input type=\"image\" name=\"action_Start_" + b64 + "\" value=\"foo\" title=\""); - out.write(_("Start the torrent")); + out.write(_t("Start the torrent")); out.write("\" src=\"" + _imgPath + "start.png\" alt=\""); - out.write(_("Start")); + out.write(_t("Start")); out.write("\">"); if (isDegraded) out.write("</a>"); @@ -1712,16 +1712,16 @@ public class I2PSnarkServlet extends BasicServlet { getQueryString(req, "", null, null).replace("?", "&") + "\"><img title=\""); else out.write("<input type=\"image\" name=\"action_Remove_" + b64 + "\" value=\"foo\" title=\""); - out.write(_("Remove the torrent from the active list, deleting the .torrent file")); + out.write(_t("Remove the torrent from the active list, deleting the .torrent file")); out.write("\" onclick=\"if (!confirm('"); // Can't figure out how to escape double quotes inside the onclick string. // Single quotes in translate strings with parameters must be doubled. // Then the remaining single quote must be escaped - out.write(_("Are you sure you want to delete the file \\''{0}\\'' (downloaded data will not be deleted) ?", + out.write(_t("Are you sure you want to delete the file \\''{0}\\'' (downloaded data will not be deleted) ?", escapeJSString(snark.getName()))); out.write("')) { return false; }\""); out.write(" src=\"" + _imgPath + "remove.png\" alt=\""); - out.write(_("Remove")); + out.write(_t("Remove")); out.write("\">"); if (isDegraded) out.write("</a>"); @@ -1734,16 +1734,16 @@ public class I2PSnarkServlet extends BasicServlet { getQueryString(req, "", null, null).replace("?", "&") + "\"><img title=\""); else out.write("<input type=\"image\" name=\"action_Delete_" + b64 + "\" value=\"foo\" title=\""); - out.write(_("Delete the .torrent file and the associated data file(s)")); + out.write(_t("Delete the .torrent file and the associated data file(s)")); out.write("\" onclick=\"if (!confirm('"); // Can't figure out how to escape double quotes inside the onclick string. // Single quotes in translate strings with parameters must be doubled. // Then the remaining single quote must be escaped - out.write(_("Are you sure you want to delete the torrent \\''{0}\\'' and all downloaded data?", + out.write(_t("Are you sure you want to delete the torrent \\''{0}\\'' and all downloaded data?", escapeJSString(fullBasename))); out.write("')) { return false; }\""); out.write(" src=\"" + _imgPath + "delete.png\" alt=\""); - out.write(_("Delete")); + out.write(_t("Delete")); out.write("\">"); if (isDegraded) out.write("</a>"); @@ -1763,7 +1763,7 @@ public class I2PSnarkServlet extends BasicServlet { String ch = pid != null ? pid.toString().substring(0, 4) : "????"; String client; if ("AwMD".equals(ch)) - client = _("I2PSnark"); + client = _t("I2PSnark"); else if ("BFJT".equals(ch)) client = "I2PRufus"; else if ("TTMt".equals(ch)) @@ -1779,7 +1779,7 @@ public class I2PSnarkServlet extends BasicServlet { else if ("LUtU".equals(ch)) client = "KTorrent" + getAzVersion(pid.getID()); else - client = _("Unknown") + " (" + ch + ')'; + client = _t("Unknown") + " (" + ch + ')'; out.write(client + "  <tt>" + peer.toString().substring(5, 9)+ "</tt>"); if (showDebug) out.write(" inactive " + (peer.getInactiveTime() / 1000) + "s"); @@ -1791,7 +1791,7 @@ public class I2PSnarkServlet extends BasicServlet { if (isValid) { pct = (float) (100.0 * peer.completed() / meta.getPieces()); if (pct >= 100.0) - out.write(_("Seed")); + out.write(_t("Seed")); else { String ps = String.valueOf(pct); if (ps.length() > 5) @@ -1814,9 +1814,9 @@ public class I2PSnarkServlet extends BasicServlet { } else { out.write("<span class=\"choked\"><a title=\""); if (!peer.isInteresting()) - out.write(_("Uninteresting (The peer has no pieces we need)")); + out.write(_t("Uninteresting (The peer has no pieces we need)")); else - out.write(_("Choked (The peer is not allowing us to request pieces)")); + out.write(_t("Choked (The peer is not allowing us to request pieces)")); out.write("\">"); out.write(formatSize(peer.getDownloadRate()) + "ps</a></span>"); } @@ -1836,9 +1836,9 @@ public class I2PSnarkServlet extends BasicServlet { } else { out.write("<span class=\"choked\"><a title=\""); if (!peer.isInterested()) - out.write(_("Uninterested (We have no pieces the peer needs)")); + out.write(_t("Uninterested (We have no pieces the peer needs)")); else - out.write(_("Choking (We are not allowing the peer to request pieces)")); + out.write(_t("Choking (We are not allowing the peer to request pieces)")); out.write("\">"); out.write(formatSize(peer.getUploadRate()) + "ps</a></span>"); } @@ -1954,7 +1954,7 @@ public class I2PSnarkServlet extends BasicServlet { StringBuilder buf = new StringBuilder(128); buf.append("<a href=\"").append(baseURL).append("details.php?dllist=1&filelist=1&info_hash=") .append(TrackerClient.urlencode(infohash)) - .append("\" title=\"").append(_("Details at {0} tracker", name)).append("\" target=\"_blank\">"); + .append("\" title=\"").append(_t("Details at {0} tracker", name)).append("\" target=\"_blank\">"); return buf.toString(); } } @@ -1971,7 +1971,7 @@ public class I2PSnarkServlet extends BasicServlet { if (linkUrl != null) { StringBuilder buf = new StringBuilder(128); buf.append(linkUrl); - toThemeImg(buf, "details", _("Info"), ""); + toThemeImg(buf, "details", _t("Info"), ""); buf.append("</a>"); return buf.toString(); } @@ -2044,31 +2044,31 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<div class=\"addtorrentsection\"><span class=\"snarkConfigTitle\">"); out.write(toThemeImg("add")); out.write(' '); - out.write(_("Add Torrent")); + out.write(_t("Add Torrent")); out.write("</span><hr>\n<table border=\"0\"><tr><td>"); - out.write(_("From URL")); + out.write(_t("From URL")); out.write(":<td><input type=\"text\" name=\"nofilter_newURL\" size=\"85\" value=\"" + newURL + "\" spellcheck=\"false\""); out.write(" title=\""); - out.write(_("Enter the torrent file download URL (I2P only), magnet link, maggot link, or info hash")); + out.write(_t("Enter the torrent file download URL (I2P only), magnet link, maggot link, or info hash")); out.write("\"> \n"); // not supporting from file at the moment, since the file name passed isn't always absolute (so it may not resolve) //out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br>"); out.write("<input type=\"submit\" class=\"add\" value=\""); - out.write(_("Add torrent")); + out.write(_t("Add torrent")); out.write("\" name=\"foo\" ><br>\n" + "<tr><td>"); - out.write(_("Data dir")); + out.write(_t("Data dir")); out.write(":<td><input type=\"text\" name=\"nofilter_newDir\" size=\"85\" value=\"\" spellcheck=\"false\""); out.write(" title=\""); - out.write(_("Enter the directory to save the data in (default {0})", _manager.getDataDir().getAbsolutePath())); + out.write(_t("Enter the directory to save the data in (default {0})", _manager.getDataDir().getAbsolutePath())); out.write("\"></td></tr>\n"); out.write("<tr><td> <td><span class=\"snarkAddInfo\">"); - out.write(_("You can also copy .torrent files to: {0}.", "<code>" + _manager.getDataDir().getAbsolutePath() + "</code>")); + out.write(_t("You can also copy .torrent files to: {0}.", "<code>" + _manager.getDataDir().getAbsolutePath() + "</code>")); out.write("\n"); - out.write(_("Removing a .torrent will cause it to stop.")); + out.write(_t("Removing a .torrent will cause it to stop.")); out.write("<br></span></table>\n"); out.write("</div></form></div>"); } @@ -2081,24 +2081,24 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<span class=\"snarkConfigTitle\">"); out.write(toThemeImg("create")); out.write(' '); - out.write(_("Create Torrent")); + out.write(_t("Create Torrent")); out.write("</span><hr>\n<table border=\"0\"><tr><td>"); //out.write("From file: <input type=\"file\" name=\"newFile\" size=\"50\" value=\"" + newFile + "\" /><br>\n"); - out.write(_("Data to seed")); + out.write(_t("Data to seed")); out.write(":<td>" + "<input type=\"text\" name=\"nofilter_baseFile\" size=\"85\" value=\"" + "\" spellcheck=\"false\" title=\""); - out.write(_("File or directory to seed (full path or within the directory {0} )", + out.write(_t("File or directory to seed (full path or within the directory {0} )", _manager.getDataDir().getAbsolutePath() + File.separatorChar)); out.write("\" ><tr><td>\n"); - out.write(_("Trackers")); + out.write(_t("Trackers")); out.write(":<td><table style=\"width: 30%;\"><tr><td></td><td align=\"center\">"); - out.write(_("Primary")); + out.write(_t("Primary")); out.write("</td><td align=\"center\">"); - out.write(_("Alternates")); + out.write(_t("Alternates")); out.write("</td><td rowspan=\"0\">" + " <input type=\"submit\" class=\"create\" value=\""); - out.write(_("Create torrent")); + out.write(_t("Create torrent")); out.write("\" name=\"foo\" >" + "</td></tr>\n"); for (Tracker t : sortedTrackers) { @@ -2116,16 +2116,16 @@ public class I2PSnarkServlet extends BasicServlet { out.write("\" value=\"foo\"></td></tr>\n"); } out.write("<tr><td><i>"); - out.write(_("none")); + out.write(_t("none")); out.write("</i></td><td align=\"center\"><input type=\"radio\" name=\"announceURL\" value=\"none\""); if (_lastAnnounceURL == null) out.write(" checked"); out.write("></td><td></td></tr></table>\n"); // make the user add a tracker on the config form now - //out.write(_("or")); + //out.write(_t("or")); //out.write(" <input type=\"text\" name=\"announceURLOther\" size=\"57\" value=\"http://\" " + // "title=\""); - //out.write(_("Specify custom tracker announce URL")); + //out.write(_t("Specify custom tracker announce URL")); //out.write("\" > " + out.write("</td></tr>" + "</table>\n" + @@ -2149,32 +2149,32 @@ public class I2PSnarkServlet extends BasicServlet { out.write("<span class=\"snarkConfigTitle\">"); out.write(toThemeImg("config")); out.write(' '); - out.write(_("Configuration")); + out.write(_t("Configuration")); out.write("</span><hr>\n" + "<table border=\"0\"><tr><td>"); - out.write(_("Data directory")); + out.write(_t("Data directory")); out.write(": <td><input name=\"nofilter_dataDir\" size=\"80\" value=\"" + DataHelper.escapeHTML(dataDir) + "\" spellcheck=\"false\"></td>\n" + "<tr><td>"); - out.write(_("Files readable by all")); + out.write(_t("Files readable by all")); out.write(": <td><input type=\"checkbox\" class=\"optbox\" name=\"filesPublic\" value=\"true\" " + (filesPublic ? "checked " : "") + "title=\""); - out.write(_("If checked, other users may access the downloaded files")); + out.write(_t("If checked, other users may access the downloaded files")); out.write("\" >" + "<tr><td>"); - out.write(_("Auto start torrents")); + out.write(_t("Auto start torrents")); out.write(": <td><input type=\"checkbox\" class=\"optbox\" name=\"autoStart\" value=\"true\" " + (autoStart ? "checked " : "") + "title=\""); - out.write(_("If checked, automatically start torrents that are added")); + out.write(_t("If checked, automatically start torrents that are added")); out.write("\" >" + "<tr><td>"); - out.write(_("Theme")); + out.write(_t("Theme")); out.write(": <td><select name='theme'>"); String theme = _manager.getTheme(); String[] themes = _manager.getThemes(); @@ -2188,7 +2188,7 @@ public class I2PSnarkServlet extends BasicServlet { out.write("</select>\n" + "<tr><td>"); - out.write(_("Refresh time")); + out.write(_t("Refresh time")); out.write(": <td><select name=\"refreshDelay\">"); int delay = _manager.getRefreshDelaySeconds(); for (int i = 0; i < times.length; i++) { @@ -2201,21 +2201,21 @@ public class I2PSnarkServlet extends BasicServlet { if (times[i] > 0) out.write(DataHelper.formatDuration2(times[i] * 1000)); else - out.write(_("Never")); + out.write(_t("Never")); out.write("</option>\n"); } out.write("</select><br>" + "<tr><td>"); - out.write(_("Startup delay")); + out.write(_t("Startup delay")); out.write(": <td><input name=\"startupDelay\" size=\"4\" class=\"r\" value=\"" + _manager.util().getStartupDelay() + "\"> "); - out.write(_("minutes")); + out.write(_t("minutes")); out.write("<br>\n" + "<tr><td>"); - out.write(_("Page size")); + out.write(_t("Page size")); out.write(": <td><input name=\"pageSize\" size=\"4\" maxlength=\"6\" class=\"r\" value=\"" + _manager.getPageSize() + "\"> "); - out.write(_("torrents")); + out.write(_t("torrents")); out.write("<br>\n"); @@ -2239,39 +2239,39 @@ public class I2PSnarkServlet extends BasicServlet { out.write("</select><br>\n"); */ out.write("<tr><td>"); - out.write(_("Total uploader limit")); + out.write(_t("Total uploader limit")); out.write(": <td><input type=\"text\" name=\"upLimit\" class=\"r\" value=\"" + _manager.util().getMaxUploaders() + "\" size=\"4\" maxlength=\"3\" > "); - out.write(_("peers")); + out.write(_t("peers")); out.write("<br>\n" + "<tr><td>"); - out.write(_("Up bandwidth limit")); + out.write(_t("Up bandwidth limit")); out.write(": <td><input type=\"text\" name=\"upBW\" class=\"r\" value=\"" + _manager.util().getMaxUpBW() + "\" size=\"4\" maxlength=\"4\" > KBps <i>"); - out.write(_("Half available bandwidth recommended.")); + out.write(_t("Half available bandwidth recommended.")); out.write(" [<a href=\"/config.jsp\" target=\"blank\">"); - out.write(_("View or change router bandwidth")); + out.write(_t("View or change router bandwidth")); out.write("</a>]</i><br>\n" + "<tr><td>"); - out.write(_("Use open trackers also")); + out.write(_t("Use open trackers also")); out.write(": <td><input type=\"checkbox\" class=\"optbox\" name=\"useOpenTrackers\" value=\"true\" " + (useOpenTrackers ? "checked " : "") + "title=\""); - out.write(_("If checked, announce torrents to open trackers as well as the tracker listed in the torrent file")); + out.write(_t("If checked, announce torrents to open trackers as well as the tracker listed in the torrent file")); out.write("\" ></td></tr>\n" + "<tr><td>"); - out.write(_("Enable DHT")); + out.write(_t("Enable DHT")); out.write(": <td><input type=\"checkbox\" class=\"optbox\" name=\"useDHT\" value=\"true\" " + (useDHT ? "checked " : "") + "title=\""); - out.write(_("If checked, use DHT")); + out.write(_t("If checked, use DHT")); out.write("\" ></td></tr>\n"); // "<tr><td>"); - //out.write(_("Open tracker announce URLs")); + //out.write(_t("Open tracker announce URLs")); //out.write(": <td><input type=\"text\" name=\"openTrackers\" value=\"" // + openTrackers + "\" size=\"50\" ><br>\n"); @@ -2283,13 +2283,13 @@ public class I2PSnarkServlet extends BasicServlet { Map<String, String> options = new TreeMap<String, String>(_manager.util().getI2CPOptions()); out.write("<tr><td>"); - out.write(_("Inbound Settings")); + out.write(_t("Inbound Settings")); out.write(":<td>"); out.write(renderOptions(1, 10, 3, options.remove("inbound.quantity"), "inbound.quantity", TUNNEL)); out.write("     "); out.write(renderOptions(0, 4, 3, options.remove("inbound.length"), "inbound.length", HOP)); out.write("<tr><td>"); - out.write(_("Outbound Settings")); + out.write(_t("Outbound Settings")); out.write(":<td>"); out.write(renderOptions(1, 10, 3, options.remove("outbound.quantity"), "outbound.quantity", TUNNEL)); out.write("     "); @@ -2297,12 +2297,12 @@ public class I2PSnarkServlet extends BasicServlet { if (!_context.isRouterContext()) { out.write("<tr><td>"); - out.write(_("I2CP host")); + out.write(_t("I2CP host")); out.write(": <td><input type=\"text\" name=\"i2cpHost\" value=\"" + _manager.util().getI2CPHost() + "\" size=\"15\" > " + "<tr><td>"); - out.write(_("I2CP port")); + out.write(_t("I2CP port")); out.write(": <td><input type=\"text\" name=\"i2cpPort\" class=\"r\" value=\"" + + _manager.util().getI2CPPort() + "\" size=\"5\" maxlength=\"5\" > <br>\n"); } @@ -2317,12 +2317,12 @@ public class I2PSnarkServlet extends BasicServlet { opts.append(key).append('=').append(val).append(' '); } out.write("<tr><td>"); - out.write(_("I2CP options")); + out.write(_t("I2CP options")); out.write(": <td><textarea name=\"i2cpOpts\" cols=\"60\" rows=\"1\" wrap=\"off\" spellcheck=\"false\" >" + opts.toString() + "</textarea><br>\n" + "<tr><td colspan=\"2\"> \n" + // spacer "<tr><td> <td><input type=\"submit\" class=\"accept\" value=\""); - out.write(_("Save configuration")); + out.write(_t("Save configuration")); out.write("\" name=\"foo\" >\n" + "<tr><td colspan=\"2\"> \n" + // spacer "</table></div></div></form>"); @@ -2337,22 +2337,22 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("<span class=\"snarkConfigTitle\">"); toThemeImg(buf, "config"); buf.append(' '); - buf.append(_("Trackers")); + buf.append(_t("Trackers")); buf.append("</span><hr>\n" + "<table class=\"trackerconfig\"><tr><th>") - //.append(_("Remove")) + //.append(_t("Remove")) .append("</th><th>") - .append(_("Name")) + .append(_t("Name")) .append("</th><th>") - .append(_("Website URL")) + .append(_t("Website URL")) .append("</th><th>") - .append(_("Standard")) + .append(_t("Standard")) .append("</th><th>") - .append(_("Open")) + .append(_t("Open")) .append("</th><th>") - .append(_("Private")) + .append(_t("Private")) .append("</th><th>") - .append(_("Announce URL")) + .append(_t("Announce URL")) .append("</th></tr>\n"); List<String> openTrackers = _manager.util().getOpenTrackers(); List<String> privateTrackers = _manager.getPrivateTrackers(); @@ -2364,7 +2364,7 @@ public class I2PSnarkServlet extends BasicServlet { boolean isKnownOpen = _manager.util().isKnownOpenTracker(t.announceURL); boolean isOpen = isKnownOpen || openTrackers.contains(t.announceURL); buf.append("<tr><td><input type=\"checkbox\" class=\"optbox\" name=\"delete_") - .append(name).append("\" title=\"").append(_("Delete")).append("\">" + + .append(name).append("\" title=\"").append(_t("Delete")).append("\">" + "</td><td>").append(name) .append("</td><td>").append(urlify(homeURL, 35)) .append("</td><td><input type=\"radio\" class=\"optbox\" value=\"0\" name=\"ttype_") @@ -2396,7 +2396,7 @@ public class I2PSnarkServlet extends BasicServlet { .append("</td></tr>\n"); } buf.append("<tr><td><b>") - .append(_("Add")).append(":</b></td>" + + .append(_t("Add")).append(":</b></td>" + "<td><input type=\"text\" class=\"trackername\" name=\"tname\" spellcheck=\"false\"></td>" + "<td><input type=\"text\" class=\"trackerhome\" name=\"thurl\" spellcheck=\"false\"></td>" + "<td><input type=\"radio\" class=\"optbox\" value=\"0\" name=\"add_tracker_type\" checked=\"checked\"></td>" + @@ -2405,12 +2405,12 @@ public class I2PSnarkServlet extends BasicServlet { "<td><input type=\"text\" class=\"trackerannounce\" name=\"taurl\" spellcheck=\"false\"></td></tr>\n" + "<tr><td colspan=\"7\"> </td></tr>\n" + // spacer "<tr><td colspan=\"2\"></td><td colspan=\"5\">\n" + - "<input type=\"submit\" name=\"taction\" class=\"default\" value=\"").append(_("Add tracker")).append("\">\n" + - "<input type=\"submit\" name=\"taction\" class=\"delete\" value=\"").append(_("Delete selected")).append("\">\n" + - "<input type=\"submit\" name=\"taction\" class=\"add\" value=\"").append(_("Add tracker")).append("\">\n" + - "<input type=\"submit\" name=\"taction\" class=\"accept\" value=\"").append(_("Save tracker configuration")).append("\">\n" + - // "<input type=\"reset\" class=\"cancel\" value=\"").append(_("Cancel")).append("\">\n" + - "<input type=\"submit\" name=\"taction\" class=\"reload\" value=\"").append(_("Restore defaults")).append("\">\n" + + "<input type=\"submit\" name=\"taction\" class=\"default\" value=\"").append(_t("Add tracker")).append("\">\n" + + "<input type=\"submit\" name=\"taction\" class=\"delete\" value=\"").append(_t("Delete selected")).append("\">\n" + + "<input type=\"submit\" name=\"taction\" class=\"add\" value=\"").append(_t("Add tracker")).append("\">\n" + + "<input type=\"submit\" name=\"taction\" class=\"accept\" value=\"").append(_t("Save tracker configuration")).append("\">\n" + + // "<input type=\"reset\" class=\"cancel\" value=\"").append(_t("Cancel")).append("\">\n" + + "<input type=\"submit\" name=\"taction\" class=\"reload\" value=\"").append(_t("Restore defaults")).append("\">\n" + "</td></tr>" + "<tr><td colspan=\"7\"> </td></tr>\n" + // spacer "</table></div></div></form>\n"); @@ -2422,7 +2422,7 @@ public class I2PSnarkServlet extends BasicServlet { "<span class=\"snarkConfigTitle\"><a href=\"configure\">"); out.write(toThemeImg("config")); out.write(' '); - out.write(_("Configuration")); + out.write(_t("Configuration")); out.write("</a></span></span></div>\n"); } @@ -2439,7 +2439,7 @@ public class I2PSnarkServlet extends BasicServlet { String trackerURL = magnet.getTrackerURL(); _manager.addMagnet(name, ih, trackerURL, true, dataDir); } catch (IllegalArgumentException iae) { - _manager.addMessage(_("Invalid magnet URL {0}", url)); + _manager.addMessage(_t("Invalid magnet URL {0}", url)); } } @@ -2474,17 +2474,17 @@ public class I2PSnarkServlet extends BasicServlet { } /** translate */ - private String _(String s) { + private String _t(String s) { return _manager.util().getString(s); } /** translate */ - private String _(String s, Object o) { + private String _t(String s, Object o) { return _manager.util().getString(s, o); } /** translate */ - private String _(String s, Object o, Object o2) { + private String _t(String s, Object o, Object o2) { return _manager.util().getString(s, o, o2); } @@ -2660,7 +2660,7 @@ public class I2PSnarkServlet extends BasicServlet { if (title.endsWith("/")) title = title.substring(0, title.length() - 1); String directory = title; - title = _("Torrent") + ": " + DataHelper.escapeHTML(title); + title = _t("Torrent") + ": " + DataHelper.escapeHTML(title); buf.append(title); buf.append("\n").append(HEADER_A).append(_themePath).append(HEADER_B) .append("\n"); @@ -2674,7 +2674,7 @@ public class I2PSnarkServlet extends BasicServlet { toThemeImg(buf, "arrow_refresh"); buf.append("  "); if (_contextName.equals(DEFAULT_NAME)) - buf.append(_("I2PSnark")); + buf.append(_t("I2PSnark")); else buf.append(_contextName); buf.append("\n"); @@ -2694,7 +2694,7 @@ public class I2PSnarkServlet extends BasicServlet { // first table - torrent info buf.append("\n"); buf.append("\n"); @@ -2704,7 +2704,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); @@ -2712,7 +2712,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); @@ -2721,7 +2721,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); @@ -2740,7 +2740,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append(trackerLink); else toThemeImg(buf, "details"); - buf.append(" ").append(_("Primary Tracker")).append(": "); + buf.append(" ").append(_t("Primary Tracker")).append(": "); buf.append(getShortTrackerLink(announce, snark.getInfoHash())); buf.append(""); } @@ -2749,7 +2749,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); } @@ -2788,7 +2788,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); } @@ -2799,7 +2799,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); } @@ -2809,7 +2809,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); } @@ -2818,7 +2818,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); } @@ -2830,7 +2830,7 @@ public class I2PSnarkServlet extends BasicServlet { if (announce != null) buf.append("&tr=").append(announce); buf.append("\">") - .append(toImg("magnet", _("Magnet link"))) + .append(toImg("magnet", _t("Magnet link"))) .append("Magnet:\n"); } else { buf.append("\n"); } // We don't have the hash of the torrent file - //buf.append(""); buf.append("\n"); @@ -2925,22 +2925,22 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("
") - .append(_("Torrent")) + .append(_t("Torrent")) .append(": ") .append(DataHelper.escapeHTML(snark.getBaseName())) .append("
"); toThemeImg(buf, "file"); buf.append(" ") - .append(_("Torrent file")) + .append(_t("Torrent file")) .append(": ") .append(DataHelper.escapeHTML(fullPath)) .append("
"); toThemeImg(buf, "file"); buf.append(" ") - .append(_("Data location")) + .append(_t("Data location")) .append(": ") .append(DataHelper.escapeHTML(snark.getStorage().getBase().getPath())) .append("
"); toThemeImg(buf, "details"); buf.append(" ") - .append(_("Info hash")) + .append(_t("Info hash")) .append(": ") .append(hex.toUpperCase(Locale.US)) .append("
"); toThemeImg(buf, "details"); buf.append(" ") - .append(_("Tracker List")).append(": "); + .append(_t("Tracker List")).append(": "); for (List alist2 : alist) { buf.append('['); boolean more = false; @@ -2774,7 +2774,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("
"); toThemeImg(buf, "details"); buf.append(" ") - .append(_("Comment")).append(": ") + .append(_t("Comment")).append(": ") .append(DataHelper.stripHTML(com)) .append("
"); toThemeImg(buf, "details"); buf.append(" ") - .append(_("Created")).append(": ") + .append(_t("Created")).append(": ") .append(date) .append("
"); toThemeImg(buf, "details"); buf.append(" ") - .append(_("Created By")).append(": ") + .append(_t("Created By")).append(": ") .append(DataHelper.stripHTML(cby)) .append("
"); toThemeImg(buf, "details"); buf.append(" ") - .append(_("Added")).append(": ") + .append(_t("Added")).append(": ") .append(date) .append("
"); toThemeImg(buf, "details"); buf.append(" ") - .append(_("Completed")).append(": ") + .append(_t("Completed")).append(": ") .append(date) .append("
") - .append(_("Private torrent")) + .append(_t("Private torrent")) .append("
").append(_("Maggot link")).append(": ") + //buf.append("
").append(_t("Maggot link")).append(": ") // .append(MAGGOT).append(hex).append(':').append(hex).append("
"); toThemeImg(buf, "size"); buf.append(" ") - .append(_("Size")) + .append(_t("Size")) .append(": ") .append(formatSize(snark.getTotalLength())); int pieces = snark.getPieces(); @@ -2863,16 +2863,16 @@ public class I2PSnarkServlet extends BasicServlet { toThemeImg(buf, "head_rx"); buf.append(" "); if (completion < 1.0) - buf.append(_("Completion")) + buf.append(_t("Completion")) .append(": ") .append((new DecimalFormat("0.00%")).format(completion)); else - buf.append(_("Complete")).append(""); + buf.append(_t("Complete")).append(""); // up ratio buf.append(" "); toThemeImg(buf, "head_tx"); buf.append(" ") - .append(_("Upload ratio")) + .append(_t("Upload ratio")) .append(": "); long uploaded = snark.getUploaded(); if (uploaded > 0) { @@ -2892,7 +2892,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append(" "); toThemeImg(buf, "head_rx"); buf.append(" ") - .append(_("Remaining")) + .append(_t("Remaining")) .append(": ") .append(formatSize(needed)); } @@ -2902,20 +2902,20 @@ public class I2PSnarkServlet extends BasicServlet { buf.append(" "); toThemeImg(buf, "file"); buf.append(" ") - .append(_("Files")) + .append(_t("Files")) .append(": ") .append(fileCount); } buf.append(" "); toThemeImg(buf, "file"); buf.append(" ") - .append(_("Pieces")) + .append(_t("Pieces")) .append(": ") .append(pieces); buf.append(" "); toThemeImg(buf, "file"); buf.append(" ") - .append(_("Piece size")) + .append(_t("Piece size")) .append(": ") .append(formatSize(snark.getPieceLength(0))) .append("
"); toThemeImg(buf, "file"); if (snark.isChecking()) { - buf.append(" ").append(_("Checking")).append("… ") + buf.append(" ").append(_t("Checking")).append("… ") .append((new DecimalFormat("0.00%")).format(snark.getCheckingProgress())) .append("   ") - .append(_("Refresh page for results")).append(""); + .append(_t("Refresh page for results")).append(""); } else if (snark.isStarting()) { - buf.append(" ").append(_("Starting")).append("…"); + buf.append(" ").append(_t("Starting")).append("…"); } else if (snark.isAllocating()) { - buf.append(" ").append(_("Allocating")).append("…"); + buf.append(" ").append(_t("Allocating")).append("…"); } else { boolean isRunning = !snark.isStopped(); buf.append(" \n"); + buf.append(_t("Stop")).append("\" name=\"stop\" class=\"stoptorrent\">\n"); else - buf.append(_("Start")).append("\" name=\"start\" class=\"starttorrent\">\n"); - buf.append("   \n"); + buf.append("   \n"); else @@ -3001,7 +3001,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n"); buf.append("\n") .append("\n\n"); @@ -3101,21 +3101,21 @@ public class I2PSnarkServlet extends BasicServlet { int priority = 0; if (fai.isDirectory) { complete = true; - //status = toImg("tick") + ' ' + _("Directory"); + //status = toImg("tick") + ' ' + _t("Directory"); } else { if (snark == null || snark.getStorage() == null) { // Assume complete, perhaps he removed a completed torrent but kept a bookmark complete = true; - status = toImg("cancel") + ' ' + _("Torrent not found?"); + status = toImg("cancel") + ' ' + _t("Torrent not found?"); } else { long remaining = fai.remaining; if (remaining < 0) { complete = true; - status = toImg("cancel") + ' ' + _("File not found in torrent?"); + status = toImg("cancel") + ' ' + _t("File not found in torrent?"); } else if (remaining == 0 || length <= 0) { complete = true; - status = toImg("tick") + ' ' + _("Complete"); + status = toImg("tick") + ' ' + _t("Complete"); } else { priority = fai.priority; if (priority < 0) @@ -3125,8 +3125,8 @@ public class I2PSnarkServlet extends BasicServlet { else status = toImg("clock_red"); status += " " + - (100 * (length - remaining) / length) + "% " + _("complete") + - " (" + DataHelper.formatSize2(remaining) + "B " + _("remaining") + ")"; + (100 * (length - remaining) / length) + "% " + _t("complete") + + " (" + DataHelper.formatSize2(remaining) + "B " + _t("remaining") + ")"; } } @@ -3148,7 +3148,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\"\""); } else { - buf.append(toImg(icon, _("Open"))).append(""); + buf.append(toImg(icon, _t("Open"))).append(""); } } else { buf.append(toImg(icon)); @@ -3172,17 +3172,17 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\n 0) buf.append("checked=\"checked\""); - buf.append('>').append(_("High")); + buf.append('>').append(_t("High")); buf.append("\n').append(_("Normal")); + buf.append('>').append(_t("Normal")); buf.append("\n').append(_("Skip")); + buf.append('>').append(_t("Skip")); showSaveButton = true; } buf.append(""); @@ -3192,12 +3192,12 @@ public class I2PSnarkServlet extends BasicServlet { if (showSaveButton) { buf.append("\n"); } diff --git a/apps/i2psnark/locale/messages_ar.po b/apps/i2psnark/locale/messages_ar.po index 5410a2daa5..502c69b90f 100644 --- a/apps/i2psnark/locale/messages_ar.po +++ b/apps/i2psnark/locale/messages_ar.po @@ -826,7 +826,7 @@ msgid "Enter valid tracker name and URLs" msgstr "" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_cs.po b/apps/i2psnark/locale/messages_cs.po index b107d9e86c..c2690f07f9 100644 --- a/apps/i2psnark/locale/messages_cs.po +++ b/apps/i2psnark/locale/messages_cs.po @@ -817,7 +817,7 @@ msgid "Enter valid tracker name and URLs" msgstr "" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_de.po b/apps/i2psnark/locale/messages_de.po index 927df100d5..dcdd0cb115 100644 --- a/apps/i2psnark/locale/messages_de.po +++ b/apps/i2psnark/locale/messages_de.po @@ -826,7 +826,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Geben Sie einen gültigen Tracker-Namen und die URLs ein" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_en.po b/apps/i2psnark/locale/messages_en.po index d29a692a65..e34056fede 100644 --- a/apps/i2psnark/locale/messages_en.po +++ b/apps/i2psnark/locale/messages_en.po @@ -808,7 +808,7 @@ msgstr "" msgid "Enter valid tracker name and URLs" msgstr "" -#. "\n" + +#. "\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_es.po b/apps/i2psnark/locale/messages_es.po index b173cff249..c7a293fd04 100644 --- a/apps/i2psnark/locale/messages_es.po +++ b/apps/i2psnark/locale/messages_es.po @@ -824,7 +824,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Introduzca nombre y URLs de tracker (rastreador) válidos" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_fr.po b/apps/i2psnark/locale/messages_fr.po index 9aa06fb15f..c8987da9ad 100644 --- a/apps/i2psnark/locale/messages_fr.po +++ b/apps/i2psnark/locale/messages_fr.po @@ -821,7 +821,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Entrez nom de tracker valide et URLs" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_hu.po b/apps/i2psnark/locale/messages_hu.po index 1029742838..6710e744ee 100644 --- a/apps/i2psnark/locale/messages_hu.po +++ b/apps/i2psnark/locale/messages_hu.po @@ -814,7 +814,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Adj meg érvényes követő (tracker) nevet és URL címeket" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_it.po b/apps/i2psnark/locale/messages_it.po index 5ad5f6edc6..e0315ca194 100644 --- a/apps/i2psnark/locale/messages_it.po +++ b/apps/i2psnark/locale/messages_it.po @@ -818,7 +818,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Inserisci nome e URL validi per il tracker" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_nb.po b/apps/i2psnark/locale/messages_nb.po index dc7cde85ea..43d9111cc2 100644 --- a/apps/i2psnark/locale/messages_nb.po +++ b/apps/i2psnark/locale/messages_nb.po @@ -813,7 +813,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Skriv inn valid tracker navn og URLer" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_nl.po b/apps/i2psnark/locale/messages_nl.po index 84b8674119..20ff930448 100644 --- a/apps/i2psnark/locale/messages_nl.po +++ b/apps/i2psnark/locale/messages_nl.po @@ -816,7 +816,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Geef een geldige trackernaam en URLs in" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_pl.po b/apps/i2psnark/locale/messages_pl.po index 854c906729..3a67840540 100644 --- a/apps/i2psnark/locale/messages_pl.po +++ b/apps/i2psnark/locale/messages_pl.po @@ -823,7 +823,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Podaj prawidłową nazwę trackera i URL" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_pt.po b/apps/i2psnark/locale/messages_pt.po index 8d356e6272..5cd2d6c44f 100644 --- a/apps/i2psnark/locale/messages_pt.po +++ b/apps/i2psnark/locale/messages_pt.po @@ -822,7 +822,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Insira um nome válido para o tracker e URLs" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_pt_bR.po b/apps/i2psnark/locale/messages_pt_bR.po index 4b20ea31fe..251188047e 100644 --- a/apps/i2psnark/locale/messages_pt_bR.po +++ b/apps/i2psnark/locale/messages_pt_bR.po @@ -814,7 +814,7 @@ msgid "Enter valid tracker name and URLs" msgstr "" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_ro.po b/apps/i2psnark/locale/messages_ro.po index 98d4bb92c8..d0575dd0ff 100644 --- a/apps/i2psnark/locale/messages_ro.po +++ b/apps/i2psnark/locale/messages_ro.po @@ -817,7 +817,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Introduceți numele tracker valid și URL-uri" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_ru.po b/apps/i2psnark/locale/messages_ru.po index 19652c1050..92a8316792 100644 --- a/apps/i2psnark/locale/messages_ru.po +++ b/apps/i2psnark/locale/messages_ru.po @@ -829,7 +829,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Введите действительное название и URL трекера" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_sk.po b/apps/i2psnark/locale/messages_sk.po index c4780b7252..339f354268 100644 --- a/apps/i2psnark/locale/messages_sk.po +++ b/apps/i2psnark/locale/messages_sk.po @@ -816,7 +816,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Zadajte platný názov a URL stopovača" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_sv.po b/apps/i2psnark/locale/messages_sv.po index 7f653edeaf..ec566c4eb5 100644 --- a/apps/i2psnark/locale/messages_sv.po +++ b/apps/i2psnark/locale/messages_sv.po @@ -822,7 +822,7 @@ msgid "Enter valid tracker name and URLs" msgstr "Ange giltigt namn och adresser för trackern " #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_vi.po b/apps/i2psnark/locale/messages_vi.po index cad895268a..d7d0e8067c 100644 --- a/apps/i2psnark/locale/messages_vi.po +++ b/apps/i2psnark/locale/messages_vi.po @@ -810,7 +810,7 @@ msgid "Enter valid tracker name and URLs" msgstr "" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2psnark/locale/messages_zh.po b/apps/i2psnark/locale/messages_zh.po index 5017281a9f..cb4216a405 100644 --- a/apps/i2psnark/locale/messages_zh.po +++ b/apps/i2psnark/locale/messages_zh.po @@ -814,7 +814,7 @@ msgid "Enter valid tracker name and URLs" msgstr "请输入有效的 Tracker 名称与链接" #. "\n" + +#. value=\"").append(_t("Cancel")).append("\">\n" + #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:1361 #: ../java/src/org/klomp/snark/web/I2PSnarkServlet.java:2410 msgid "Restore defaults" diff --git a/apps/i2ptunnel/java/bundle-messages-proxy.sh b/apps/i2ptunnel/java/bundle-messages-proxy.sh index 8ffdc5a9eb..147e32952f 100755 --- a/apps/i2ptunnel/java/bundle-messages-proxy.sh +++ b/apps/i2ptunnel/java/bundle-messages-proxy.sh @@ -62,16 +62,16 @@ do echo "Updating the $i file from the tags..." # extract strings from java and jsp files, and update messages.po files # translate calls must be one of the forms: - # _("foo") + # _t("foo") # _x("foo") - # intl._("foo") + # intl._t("foo") # intl.title("foo") # In a jsp, you must use a helper or handler that has the context set. # To start a new translation, copy the header from an old translation to the new .po file, # then ant distclean updater. find $JPATHS -name *.java > $TMPFILE xgettext -f $TMPFILE -F -L java --from-code=UTF-8 --add-comments\ - --keyword=_ \ + --keyword=_t \ -o ${i}t if [ $? -ne 0 ] then diff --git a/apps/i2ptunnel/java/bundle-messages.sh b/apps/i2ptunnel/java/bundle-messages.sh index a8769f0dcc..29a0bec93b 100755 --- a/apps/i2ptunnel/java/bundle-messages.sh +++ b/apps/i2ptunnel/java/bundle-messages.sh @@ -61,16 +61,16 @@ do echo "Updating the $i file from the tags..." # extract strings from java and jsp files, and update messages.po files # translate calls must be one of the forms: - # _("foo") + # _t("foo") # _x("foo") - # intl._("foo") + # intl._t("foo") # intl.title("foo") # In a jsp, you must use a helper or handler that has the context set. # To start a new translation, copy the header from an old translation to the new .po file, # then ant distclean updater. find $JPATHS -name *.java > $TMPFILE xgettext -f $TMPFILE -F -L java --from-code=UTF-8 --add-comments\ - --keyword=_ --keyword=_x --keyword=intl._ --keyword=intl.title \ + --keyword=_t --keyword=_x --keyword=intl._ --keyword=intl.title \ -o ${i}t if [ $? -ne 0 ] then diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java index 8645b686f4..4183ce3991 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClient.java @@ -631,8 +631,8 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn String header = getErrorPage("ahelper-notfound", ERR_AHELPER_NOTFOUND); try { out.write(header.getBytes("UTF-8")); - out.write(("

" + _("This seems to be a bad destination:") + " " + ahelperKey + " " + - _("i2paddresshelper cannot help you with a destination like that!") + + out.write(("

" + _t("This seems to be a bad destination:") + " " + ahelperKey + " " + + _t("i2paddresshelper cannot help you with a destination like that!") + "

").getBytes("UTF-8")); writeFooter(out); reader.drain(); @@ -706,7 +706,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn String conflictURL = conflictURI.toASCIIString(); String header = getErrorPage("ahelper-conflict", ERR_AHELPER_CONFLICT); out.write(header.getBytes("UTF-8")); - out.write(_("To visit the destination in your host database, click here. To visit the conflicting addresshelper destination, click here.", + out.write(_t("To visit the destination in your host database, click here. To visit the conflicting addresshelper destination, click here.", trustedURL, conflictURL).getBytes("UTF-8")); out.write("

".getBytes("UTF-8")); writeFooter(out); @@ -1118,7 +1118,7 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn header = getErrorPage("dnfb", ERR_DESTINATION_UNKNOWN); } else if(destination.length() == 60 && destination.toLowerCase(Locale.US).endsWith(".b32.i2p")) { header = getErrorPage("nols", ERR_DESTINATION_UNKNOWN); - extraMessage = _("Destination lease set not found"); + extraMessage = _t("Destination lease set not found"); } else { header = getErrorPage("dnfh", ERR_DESTINATION_UNKNOWN); jumpServers = getTunnel().getClientOptions().getProperty(PROP_JUMP_SERVERS); @@ -1270,31 +1270,31 @@ public class I2PTunnelHTTPClient extends I2PTunnelHTTPClientBase implements Runn Writer out = new BufferedWriter(new OutputStreamWriter(outs, "UTF-8")); String header = getErrorPage("ahelper-new", ERR_AHELPER_NEW); out.write(header); - out.write("
"); - String tx = _("Directory"); + String tx = _t("Directory"); // cycle through sort by name or type String sort; boolean isTypeSort = false; @@ -3021,7 +3021,7 @@ public class I2PSnarkServlet extends BasicServlet { .append(getQueryString(sort)).append("\">"); } toThemeImg(buf, "file", tx, - showSort ? _("Sort by {0}", (isTypeSort ? _("File type") : _("Name"))) + showSort ? _t("Sort by {0}", (isTypeSort ? _t("File type") : _t("Name"))) : tx + ": " + directory); if (showSort) buf.append(""); @@ -3036,9 +3036,9 @@ public class I2PSnarkServlet extends BasicServlet { buf.append(""); } - tx = _("Size"); + tx = _t("Size"); toThemeImg(buf, "size", tx, - showSort ? _("Sort by {0}", tx) : tx); + showSort ? _t("Sort by {0}", tx) : tx); if (showSort) buf.append(""); buf.append(""); @@ -3048,9 +3048,9 @@ public class I2PSnarkServlet extends BasicServlet { buf.append(""); } - tx = _("Status"); + tx = _t("Status"); toThemeImg(buf, "status", tx, - showRemainingSort ? _("Sort by {0}", _("Remaining")) : tx); + showRemainingSort ? _t("Sort by {0}", _t("Remaining")) : tx); if (showRemainingSort) buf.append(""); if (showPriority) { @@ -3060,9 +3060,9 @@ public class I2PSnarkServlet extends BasicServlet { buf.append(""); } - tx = _("Priority"); + tx = _t("Priority"); toThemeImg(buf, "priority", tx, - showSort ? _("Sort by {0}", tx) : tx); + showSort ? _t("Sort by {0}", tx) : tx); if (showSort) buf.append(""); } @@ -3072,7 +3072,7 @@ public class I2PSnarkServlet extends BasicServlet { buf.append("\">"); toThemeImg(buf, "up"); buf.append(' ') - .append(_("Up to higher level directory")) + .append(_t("Up to higher level directory")) .append("
 " + "") - .append(toImg("clock_red")).append(_("Set all high")).append("\n" + + .append(toImg("clock_red")).append(_t("Set all high")).append("\n" + "") - .append(toImg("clock")).append(_("Set all normal")).append("\n" + + .append(toImg("clock")).append(_t("Set all normal")).append("\n" + "") - .append(toImg("cancel")).append(_("Skip all")).append("\n" + - "

\n" + + "

\n" + "
"); + buf.append(""); else if (in.getLength() <= 1 || in.getLength() + in.getLengthVariance() <= 1 || out.getLength() <= 1 || out.getLength() + out.getLengthVariance() <= 1) - buf.append(""); + buf.append(""); if (in.getLength() + Math.abs(in.getLengthVariance()) >= WARN_LENGTH || out.getLength() + Math.abs(out.getLengthVariance()) >= WARN_LENGTH) - buf.append(""); + buf.append(""); if (in.getTotalQuantity() >= WARN_QUANTITY || out.getTotalQuantity() >= WARN_QUANTITY) - buf.append(""); + buf.append(""); - buf.append("\n"); + buf.append("\n"); // buf.append("\n"); // tunnel depth int maxLength = advanced ? MAX_ADVANCED_LENGTH : MAX_LENGTH; - buf.append("\n"); + buf.append("\n"); buf.append("\n"); // tunnel depth variance - buf.append("\n"); + buf.append("\n"); buf.append("\n"); + buf.append("\n"); buf.append("\n"); + buf.append("\n"); buf.append("\n" + + buf.append("\n" + "\n" + + buf.append("\n" + "
" + _("Host") + + out.write("\n"); try { String b32 = Base32.encode(SHA256Generator.getInstance().calculateHash(Base64.decode(ahelperKey)).getData()); - out.write("" + + out.write("" + ""); } catch(Exception e) { } - out.write("
" + _t("Host") + "" + destination + "
" + _("Base 32") + "
" + _t("Base 32") + "" + b32 + ".b32.i2p
" + _("Destination") + "" + + out.write("
" + _t("Destination") + "" + "
\n" + "
" + // FIXME if there is a query remaining it is lost "
" + - "" + + "" + "
\n
" + "\n" + "\n" + "\n" + "
\n"); + _t("Save {0} to router address book and continue to website", destination) + "
\n"); if(_context.namingService().getName().equals("BlockfileNamingService")) { // only blockfile supports multiple books - out.write("

\n"); - out.write("\n"); + out.write("

\n"); + out.write("\n"); } // Firefox (and others?) don't send referer to meta refresh target, which is // what the jump servers use, so this isn't that useful. diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java index 5824f1fc36..5e39cf3b83 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/I2PTunnelHTTPClientBase.java @@ -684,7 +684,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem out.write(""); if (usingWWWProxy) { out.write("

"); - out.write(_("HTTP Outproxy")); + out.write(_t("HTTP Outproxy")); out.write(": " + wwwProxy); } if (extraMessage != null) { @@ -723,7 +723,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem if (first) { first = false; out.write("

"); - out.write(_("Click a link below for an address helper from a jump service")); + out.write(_t("Click a link below for an address helper from a jump service")); out.write("

\n"); } else { out.write("
"); @@ -733,7 +733,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem out.write(uri); out.write("\">"); // Translators: parameter is a host name - out.write(_("{0} jump service", jumphost)); + out.write(_t("{0} jump service", jumphost)); out.write("\n"); } } @@ -778,7 +778,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem * Translate * @since 0.9.14 moved from I2PTunnelHTTPClient */ - protected String _(String key) { + protected String _t(String key) { return Translate.getString(key, _context, BUNDLE_NAME); } @@ -787,7 +787,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem * {0} * @since 0.9.14 moved from I2PTunnelHTTPClient */ - protected String _(String key, Object o) { + protected String _t(String key, Object o) { return Translate.getString(key, o, _context, BUNDLE_NAME); } @@ -796,7 +796,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem * {0} and {1} * @since 0.9.14 moved from I2PTunnelHTTPClient */ - protected String _(String key, Object o, Object o2) { + protected String _t(String key, Object o, Object o2) { return Translate.getString(key, o, o2, _context, BUNDLE_NAME); } } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java index 2d70caed03..15e67de745 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/localServer/LocalHTTPServer.java @@ -166,9 +166,9 @@ public abstract class LocalHTTPServer { nsOptions.setProperty("list", book); if (referer != null && referer.startsWith("http")) { String from = "" + referer + ""; - nsOptions.setProperty("s", _("Added via address helper from {0}", from)); + nsOptions.setProperty("s", _t("Added via address helper from {0}", from)); } else { - nsOptions.setProperty("s", _("Added via address helper")); + nsOptions.setProperty("s", _t("Added via address helper")); } boolean success = ns.put(host, dest, nsOptions); writeRedirectPage(out, success, host, book, url); @@ -185,11 +185,11 @@ public abstract class LocalHTTPServer { private static void writeRedirectPage(OutputStream out, boolean success, String host, String book, String url) throws IOException { String tbook; if ("hosts.txt".equals(book)) - tbook = _("router"); + tbook = _t("router"); else if ("userhosts.txt".equals(book)) - tbook = _("master"); + tbook = _t("master"); else if ("privatehosts.txt".equals(book)) - tbook = _("private"); + tbook = _t("private"); else tbook = book; out.write(("HTTP/1.1 200 OK\r\n"+ @@ -198,22 +198,22 @@ public abstract class LocalHTTPServer { "Proxy-Connection: close\r\n"+ "\r\n"+ ""+ - "" + _("Redirecting to {0}", host) + "\n" + + "" + _t("Redirecting to {0}", host) + "\n" + "\n" + "\n" + "\n" + "\n" + "" + "
\n" + "

" + (success ? - _("Saved {0} to the {1} addressbook, redirecting now.", host, tbook) : - _("Failed to save {0} to the {1} addressbook, redirecting now.", host, tbook)) + + _t("Saved {0} to the {1} addressbook, redirecting now.", host, tbook) : + _t("Failed to save {0} to the {1} addressbook, redirecting now.", host, tbook)) + "

\n

" + - _("Click here if you are not redirected automatically.") + + _t("Click here if you are not redirected automatically.") + "

").getBytes("UTF-8")); I2PTunnelHTTPClient.writeFooter(out); out.flush(); @@ -248,17 +248,17 @@ public abstract class LocalHTTPServer { private static final String BUNDLE_NAME = "net.i2p.i2ptunnel.proxy.messages"; /** lang in routerconsole.lang property, else current locale */ - protected static String _(String key) { + protected static String _t(String key) { return Translate.getString(key, I2PAppContext.getGlobalContext(), BUNDLE_NAME); } /** {0} */ - protected static String _(String key, Object o) { + protected static String _t(String key, Object o) { return Translate.getString(key, o, I2PAppContext.getGlobalContext(), BUNDLE_NAME); } /** {0} and {1} */ - protected static String _(String key, Object o, Object o2) { + protected static String _t(String key, Object o, Object o2) { return Translate.getString(key, o, o2, I2PAppContext.getGlobalContext(), BUNDLE_NAME); } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java index 0cc4e52788..b2b38398eb 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/ui/GeneralHelper.java @@ -146,11 +146,11 @@ public class GeneralHelper { List rv = tcg.clearAllMessages(); try { tcg.saveConfig(); - rv.add(0, _("Configuration changes saved", context)); + rv.add(0, _t("Configuration changes saved", context)); } catch (IOException ioe) { Log log = context.logManager().getLog(GeneralHelper.class); log.error("Failed to save config file", ioe); - rv.add(0, _("Failed to save configuration", context) + ": " + ioe.toString()); + rv.add(0, _t("Failed to save configuration", context) + ": " + ioe.toString()); } return rv; } @@ -714,7 +714,7 @@ public class GeneralHelper { return def; } - protected static String _(String key, I2PAppContext context) { - return Messages._(key, context); + protected static String _t(String key, I2PAppContext context) { + return Messages._t(key, context); } } diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java index ebc4950981..fb9b137b22 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/EditBean.java @@ -358,7 +358,7 @@ public class EditBean extends IndexBean { public String getI2CPHost(int tunnel) { if (_context.isRouterContext()) - return _("internal"); + return _t("internal"); TunnelController tun = getController(tunnel); if (tun != null) return tun.getI2CPHost(); @@ -368,7 +368,7 @@ public class EditBean extends IndexBean { public String getI2CPPort(int tunnel) { if (_context.isRouterContext()) - return _("internal"); + return _t("internal"); TunnelController tun = getController(tunnel); if (tun != null) return tun.getI2CPPort(); @@ -406,11 +406,11 @@ public class EditBean extends IndexBean { if (i <= 3) { buf.append(" ("); if (i == 1) - buf.append(_("lower bandwidth and reliability")); + buf.append(_t("lower bandwidth and reliability")); else if (i == 2) - buf.append(_("standard bandwidth and reliability")); + buf.append(_t("standard bandwidth and reliability")); else if (i == 3) - buf.append(_("higher bandwidth and reliability")); + buf.append(_t("higher bandwidth and reliability")); buf.append(')'); } buf.append("\n"); diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java index ccb30ca992..15eb3f29ee 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/IndexBean.java @@ -84,7 +84,7 @@ public class IndexBean { String error; try { tcg = TunnelControllerGroup.getInstance(); - error = tcg == null ? _("Tunnels are not initialized yet, please reload in two minutes.") + error = tcg == null ? _t("Tunnels are not initialized yet, please reload in two minutes.") : null; } catch (IllegalArgumentException iae) { tcg = null; @@ -157,9 +157,9 @@ public class IndexBean { // If passwords are turned on, all is assumed good if (!_context.getBooleanProperty(PROP_PW_ENABLE) && !haveNonce(_curNonce)) - return _("Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.") + return _t("Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.") + ' ' + - _("If the problem persists, verify that you have cookies enabled in your browser."); + _t("If the problem persists, verify that you have cookies enabled in your browser."); if ("Stop all".equals(_action)) return stopAll(); else if ("Start all".equals(_action)) @@ -205,7 +205,7 @@ public class IndexBean { private String reloadConfig() { _group.reloadControllers(); - return _("Configuration reloaded for all tunnels"); + return _t("Configuration reloaded for all tunnels"); } private String start() { @@ -219,7 +219,7 @@ public class IndexBean { try { Thread.sleep(1000); } catch (InterruptedException ie) {} // and give them something to look at in any case // FIXME name will be HTML escaped twice - return _("Starting tunnel") + ' ' + getTunnelName(_tunnel) + "..."; + return _t("Starting tunnel") + ' ' + getTunnelName(_tunnel) + "..."; } private String stop() { @@ -233,7 +233,7 @@ public class IndexBean { try { Thread.sleep(1000); } catch (InterruptedException ie) {} // and give them something to look at in any case // FIXME name will be HTML escaped twice - return _("Stopping tunnel") + ' ' + getTunnelName(_tunnel) + "..."; + return _t("Stopping tunnel") + ' ' + getTunnelName(_tunnel) + "..."; } private String saveChanges() { @@ -322,7 +322,7 @@ public class IndexBean { if (name != null) return DataHelper.escapeHTML(name); else - return _("New Tunnel"); + return _t("New Tunnel"); } /** @@ -342,13 +342,13 @@ public class IndexBean { if (tun != null && tun.getListenPort() != null) { String port = tun.getListenPort(); if (port.length() == 0) - return "" + _("Port not set") + ""; + return "" + _t("Port not set") + ""; int iport = Addresses.getPort(port); if (iport == 0) - return "" + _("Invalid port") + ' ' + port + ""; + return "" + _t("Invalid port") + ' ' + port + ""; if (iport < 1024) return "" + - _("Warning - ports less than 1024 are not recommended") + + _t("Warning - ports less than 1024 are not recommended") + ": " + port + ""; // dup check, O(n**2) List controllers = _group.getControllers(); @@ -357,12 +357,12 @@ public class IndexBean { continue; if (port.equals(controllers.get(i).getListenPort())) return "" + - _("Warning - duplicate port") + + _t("Warning - duplicate port") + ": " + port + ""; } return port; } - return "" + _("Port not set") + ""; + return "" + _t("Port not set") + ""; } public String getTunnelType(int tunnel) { @@ -374,18 +374,18 @@ public class IndexBean { } public String getTypeName(String internalType) { - if (TunnelController.TYPE_STD_CLIENT.equals(internalType)) return _("Standard client"); - else if (TunnelController.TYPE_HTTP_CLIENT.equals(internalType)) return _("HTTP/HTTPS client"); - else if (TunnelController.TYPE_IRC_CLIENT.equals(internalType)) return _("IRC client"); - else if (TunnelController.TYPE_STD_SERVER.equals(internalType)) return _("Standard server"); - else if (TunnelController.TYPE_HTTP_SERVER.equals(internalType)) return _("HTTP server"); - else if (TunnelController.TYPE_SOCKS.equals(internalType)) return _("SOCKS 4/4a/5 proxy"); - else if (TunnelController.TYPE_SOCKS_IRC.equals(internalType)) return _("SOCKS IRC proxy"); - else if (TunnelController.TYPE_CONNECT.equals(internalType)) return _("CONNECT/SSL/HTTPS proxy"); - else if (TunnelController.TYPE_IRC_SERVER.equals(internalType)) return _("IRC server"); - else if (TunnelController.TYPE_STREAMR_CLIENT.equals(internalType)) return _("Streamr client"); - else if (TunnelController.TYPE_STREAMR_SERVER.equals(internalType)) return _("Streamr server"); - else if (TunnelController.TYPE_HTTP_BIDIR_SERVER.equals(internalType)) return _("HTTP bidir"); + if (TunnelController.TYPE_STD_CLIENT.equals(internalType)) return _t("Standard client"); + else if (TunnelController.TYPE_HTTP_CLIENT.equals(internalType)) return _t("HTTP/HTTPS client"); + else if (TunnelController.TYPE_IRC_CLIENT.equals(internalType)) return _t("IRC client"); + else if (TunnelController.TYPE_STD_SERVER.equals(internalType)) return _t("Standard server"); + else if (TunnelController.TYPE_HTTP_SERVER.equals(internalType)) return _t("HTTP server"); + else if (TunnelController.TYPE_SOCKS.equals(internalType)) return _t("SOCKS 4/4a/5 proxy"); + else if (TunnelController.TYPE_SOCKS_IRC.equals(internalType)) return _t("SOCKS IRC proxy"); + else if (TunnelController.TYPE_CONNECT.equals(internalType)) return _t("CONNECT/SSL/HTTPS proxy"); + else if (TunnelController.TYPE_IRC_SERVER.equals(internalType)) return _t("IRC server"); + else if (TunnelController.TYPE_STREAMR_CLIENT.equals(internalType)) return _t("Streamr client"); + else if (TunnelController.TYPE_STREAMR_SERVER.equals(internalType)) return _t("Streamr server"); + else if (TunnelController.TYPE_HTTP_BIDIR_SERVER.equals(internalType)) return _t("HTTP bidir"); else return internalType; } @@ -442,15 +442,15 @@ public class IndexBean { host = tun.getTargetHost(); String port = tun.getTargetPort(); if (host == null || host.length() == 0) - host = "" + _("Host not set") + ""; + host = "" + _t("Host not set") + ""; else if (Addresses.getIP(host) == null) - host = "" + _("Invalid address") + ' ' + host + ""; + host = "" + _t("Invalid address") + ' ' + host + ""; else if (host.indexOf(':') >= 0) host = '[' + host + ']'; if (port == null || port.length() == 0) - port = "" + _("Port not set") + ""; + port = "" + _t("Port not set") + ""; else if (Addresses.getPort(port) == 0) - port = "" + _("Invalid port") + ' ' + port + ""; + port = "" + _t("Invalid port") + ' ' + port + ""; return host + ':' + port; } else return ""; @@ -1074,8 +1074,8 @@ public class IndexBean { } } - protected String _(String key) { - return Messages._(key, _context); + protected String _t(String key) { + return Messages._t(key, _context); } /** translate (ngettext) diff --git a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/Messages.java b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/Messages.java index d4a2fb4bdc..89e2bfc431 100644 --- a/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/Messages.java +++ b/apps/i2ptunnel/java/src/net/i2p/i2ptunnel/web/Messages.java @@ -16,11 +16,11 @@ public class Messages { } /** lang in routerconsole.lang property, else current locale */ - public String _(String key) { + public String _t(String key) { return Translate.getString(key, _context, BUNDLE_NAME); } - public static String _(String key, I2PAppContext ctx) { + public static String _t(String key, I2PAppContext ctx) { return Translate.getString(key, ctx, BUNDLE_NAME); } @@ -32,11 +32,11 @@ public class Messages { * The {0} will be replaced by the parameter. * Single quotes must be doubled, i.e. ' -> '' in the string. * @param o parameter, not translated. - * To tranlslate parameter also, use _("foo {0} bar", _("baz")) + * To tranlslate parameter also, use _t("foo {0} bar", _t("baz")) * Do not double the single quotes in the parameter. * Use autoboxing to call with ints, longs, floats, etc. */ - public String _(String s, Object o) { + public String _t(String s, Object o) { return Translate.getString(s, o, _context, BUNDLE_NAME); } diff --git a/apps/i2ptunnel/jsp/editClient.jsp b/apps/i2ptunnel/jsp/editClient.jsp index c0dd04cf47..5fbc62dd44 100644 --- a/apps/i2ptunnel/jsp/editClient.jsp +++ b/apps/i2ptunnel/jsp/editClient.jsp @@ -16,7 +16,7 @@ %> - <%=intl._("Hidden Services Manager")%> - <%=intl._("Edit Client Tunnel")%> + <%=intl._t("Hidden Services Manager")%> - <%=intl._t("Edit Client Tunnel")%> @@ -49,11 +49,11 @@ input.default { width: 1px; height: 1px; visibility: hidden; } if (curTunnel >= 0) { tunnelTypeName = editBean.getTunnelType(curTunnel); tunnelType = editBean.getInternalType(curTunnel); - %>

<%=intl._("Edit proxy settings")%>

<% + %>

<%=intl._t("Edit proxy settings")%>

<% } else { tunnelTypeName = editBean.getTypeName(request.getParameter("type")); tunnelType = net.i2p.data.DataHelper.stripHTML(request.getParameter("type")); - %>

<%=intl._("New proxy settings")%>

<% + %>

<%=intl._t("New proxy settings")%>

<% } %> @@ -87,17 +87,17 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
- + <%=tunnelTypeName%>
@@ -108,9 +108,9 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
<% if ("streamrclient".equals(tunnelType)) { %> - + <% } else { %> - + <% } /* streamrclient */ %>
@@ -119,7 +119,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% String value = editBean.getClientPort(curTunnel); if (value == null || "".equals(value.trim())) { out.write(" ("); - out.write(intl._("required")); + out.write(intl._t("required")); out.write(")"); } %> @@ -134,14 +134,14 @@ input.default { width: 1px; height: 1px; visibility: hidden; } String targetHost = editBean.getTargetHost(curTunnel); if (targetHost == null || "".equals(targetHost.trim())) { out.write(" ("); - out.write(intl._("required")); + out.write(intl._t("required")); out.write(")"); } %> <% } else { %> - <%=intl._("Reachable by")%>(R): + <%=intl._t("Reachable by")%>(R): class="tickbox" />
@@ -176,41 +176,41 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { %>
<% if ("httpclient".equals(tunnelType)) { %>
<% } // httpclient %>
class="tickbox" /> - <%=intl._("(Check the Box for 'YES')")%> + <%=intl._t("(Check the Box for 'YES')")%>
<% } else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) { %>
- (<%=intl._("name, name:port, or destination")%> + (<%=intl._t("name, name:port, or destination")%> <% if ("streamrclient".equals(tunnelType)) { /* deferred resolution unimplemented in streamr client */ %> - - <%=intl._("b32 not recommended")%> + - <%=intl._t("b32 not recommended")%> <% } %> )
@@ -218,26 +218,26 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% if (!"streamrclient".equals(tunnelType)) { %>
class="tickbox" /> - <%=intl._("(Share tunnels with other clients and irc/httpclients? Change requires restart of client proxy)")%> + <%=intl._t("(Share tunnels with other clients and irc/httpclients? Change requires restart of client proxy)")%>
<% } // !streamrclient %>
class="tickbox" /> - <%=intl._("(Check the Box for 'YES')")%> + <%=intl._t("(Check the Box for 'YES')")%>
<% if ("ircclient".equals(tunnelType)) { %>
class="tickbox" /> - <%=intl._("(Check the Box for 'YES')")%> + <%=intl._t("(Check the Box for 'YES')")%>
<% } // ircclient %> @@ -247,8 +247,8 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
-

<%=intl._("Advanced networking options")%>


- <%=intl._("(NOTE: when this client proxy is configured to share tunnels, then these options are for all the shared proxy clients!)")%> +

<%=intl._t("Advanced networking options")%>


+ <%=intl._t("(NOTE: when this client proxy is configured to share tunnels, then these options are for all the shared proxy clients!)")%>
@@ -256,42 +256,42 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
- +
<% int tunnelBackupQuantity = editBean.getTunnelBackupQuantity(curTunnel, 0); - %> - - - + %> + + + <% if (tunnelBackupQuantity > 3) { - %> + %> <% } %>
@@ -320,20 +320,20 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% if (!"streamrclient".equals(tunnelType)) { %>
class="tickbox" /> - (<%=intl._("for request/response connections")%>) + (<%=intl._t("for request/response connections")%>)
@@ -342,17 +342,17 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% } // !streamrclient %>
- +
readonly="readonly" <% } %> />
readonly="readonly" <% } %> />
@@ -364,12 +364,12 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
class="tickbox" />
@@ -381,24 +381,24 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
class="tickbox" />
@@ -409,31 +409,31 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
class="tickbox" />
- + - +
class="tickbox" /><%=intl._("Enable")%><%=intl._t("Enable")%> class="tickbox" /><%=intl._("Disable")%>
<%=intl._t("Disable")%>
@@ -445,16 +445,16 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "socksirctunnel".equals(tunnelType) || "sockstunnel".equals(tunnelType)) { %>
- + class="tickbox" />
- +
<% @@ -462,12 +462,12 @@ input.default { width: 1px; height: 1px; visibility: hidden; } if (destb64.length() > 0) { %>
- + <%=editBean.getDestHashBase32(curTunnel)%>
<% } // if destb64 %> @@ -479,31 +479,31 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% if ("httpclient".equals(tunnelType)) { %>
- +
- + class="tickbox" />

- +
- + class="tickbox" />

- +
- + class="tickbox" />

- +
- + class="tickbox" />
@@ -516,8 +516,8 @@ input.default { width: 1px; height: 1px; visibility: hidden; } %>
@@ -558,23 +558,23 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { %>
- +
class="tickbox" />
@@ -582,23 +582,23 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
- +
class="tickbox" />
@@ -609,7 +609,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; } <% if ("httpclient".equals(tunnelType)) { %>
- +
@@ -621,7 +621,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
@@ -634,9 +634,9 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
diff --git a/apps/i2ptunnel/jsp/editServer.jsp b/apps/i2ptunnel/jsp/editServer.jsp index 0d7c050937..4a0a7eabfb 100644 --- a/apps/i2ptunnel/jsp/editServer.jsp +++ b/apps/i2ptunnel/jsp/editServer.jsp @@ -16,7 +16,7 @@ %> - <%=intl._("Hidden Services Manager")%> - <%=intl._("Edit Hidden Service")%> + <%=intl._t("Hidden Services Manager")%> - <%=intl._t("Edit Hidden Service")%> @@ -49,11 +49,11 @@ input.default { width: 1px; height: 1px; visibility: hidden; } if (curTunnel >= 0) { tunnelTypeName = editBean.getTunnelType(curTunnel); tunnelType = editBean.getInternalType(curTunnel); - %>

<%=intl._("Edit server settings")%>

<% + %>

<%=intl._t("Edit server settings")%>

<% } else { tunnelTypeName = editBean.getTypeName(request.getParameter("type")); tunnelType = net.i2p.data.DataHelper.stripHTML(request.getParameter("type")); - %>

<%=intl._("New server settings")%>

<% + %>

<%=intl._t("New server settings")%>

<% } %> @@ -87,26 +87,26 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
- + <%=tunnelTypeName%>
class="tickbox" /> - <%=intl._("(Check the Box for 'YES')")%> + <%=intl._t("(Check the Box for 'YES')")%>
@@ -115,26 +115,26 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
<% if ("streamrserver".equals(tunnelType)) { %> - + <% } else { %> - + <% } %>
<% if (!"streamrserver".equals(tunnelType)) { %>
<% } /* !streamrserver */ %>
- +
") - .append(_("Start")).append(" ").append(index).append(""); + .append(_t("Start")).append(" ").append(index).append(""); } if (showStopButton && (!edit)) buf.append(""); + .append(_t("Stop")).append(" ").append(index).append(""); if (isClientChangeEnabled() && showEditButton && (!edit) && !ro) buf.append(""); + .append(_t("Edit")).append(" ").append(index).append(""); if (showUpdateButton && (!edit) && !ro) { buf.append(""); + .append(_t("Check for updates")).append(" ").append(index).append(""); buf.append(""); + .append(_t("Update")).append(" ").append(index).append(""); } if (showDeleteButton && (!edit) && !ro) { buf.append(""); + .append(_t("Delete")).append(" ").append(index).append(""); } buf.append(""); if (edit && !ro) { diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigHomeHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigHomeHandler.java index 5e426988e7..f26b182a0c 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigHomeHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigHomeHandler.java @@ -18,15 +18,15 @@ public class ConfigHomeHandler extends FormHandler { protected void processForm() { if (_action == null) return; String group = getJettyString("group"); - boolean deleting = _action.equals(_("Delete selected")); - boolean adding = _action.equals(_("Add item")); - boolean restoring = _action.equals(_("Restore defaults")); - if (_action.equals(_("Save")) && "0".equals(group)) { + boolean deleting = _action.equals(_t("Delete selected")); + boolean adding = _action.equals(_t("Add item")); + boolean restoring = _action.equals(_t("Restore defaults")); + if (_action.equals(_t("Save")) && "0".equals(group)) { boolean old = _context.getBooleanProperty(HomeHelper.PROP_OLDHOME); boolean nnew = getJettyString("oldHome") != null; if (old != nnew) { _context.router().saveConfig(HomeHelper.PROP_OLDHOME, "" + nnew); - addFormNotice(_("Home page changed")); + addFormNotice(_t("Home page changed")); } } else if (adding || deleting || restoring) { String prop; @@ -48,7 +48,7 @@ public class ConfigHomeHandler extends FormHandler { //_context.router().saveConfig(prop, dflt); // remove config so user will see updates _context.router().saveConfig(prop, null); - addFormNotice(_("Restored default settings")); + addFormNotice(_t("Restored default settings")); return; } String config = _context.getProperty(prop, dflt); @@ -60,12 +60,12 @@ public class ConfigHomeHandler extends FormHandler { if (adding) { String name = getJettyString("nofilter_name"); if (name == null || name.length() <= 0) { - addFormError(_("No name entered")); + addFormError(_t("No name entered")); return; } String url = getJettyString("nofilter_url"); if (url == null || url.length() <= 0) { - addFormError(_("No URL entered")); + addFormError(_t("No URL entered")); return; } // these would get double-escaped so we can't do it this way... @@ -81,7 +81,7 @@ public class ConfigHomeHandler extends FormHandler { else app = new HomeHelper.App(name, "", url, "/themes/console/images/question.png"); apps.add(app); - addFormNotice(_("Added") + ": " + app.name); + addFormNotice(_t("Added") + ": " + app.name); } else { // deleting Set toDelete = new HashSet(); @@ -98,13 +98,13 @@ public class ConfigHomeHandler extends FormHandler { HomeHelper.App app = iter.next(); if (toDelete.contains(app.name)) { iter.remove(); - addFormNotice(_("Removed") + ": " + app.name); + addFormNotice(_t("Removed") + ": " + app.name); } } } HomeHelper.saveApps(_context, prop, apps, !("3".equals(group))); } else { - //addFormError(_("Unsupported")); + //addFormError(_t("Unsupported")); } } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHandler.java index 97b8cb3a64..b5930895ba 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigKeyringHandler.java @@ -15,12 +15,12 @@ public class ConfigKeyringHandler extends FormHandler { @Override protected void processForm() { if (_action == null) return; - boolean adding = _action.equals(_("Add key")); - if (adding || _action.equals(_("Delete key"))) { + boolean adding = _action.equals(_t("Add key")); + if (adding || _action.equals(_t("Delete key"))) { if (_peer == null) - addFormError(_("You must enter a destination")); + addFormError(_t("You must enter a destination")); if (_key == null && adding) - addFormError(_("You must enter a key")); + addFormError(_t("You must enter a key")); if (_peer == null || (_key == null && adding)) return; Hash h = ConvertToHash.getHash(_peer); @@ -31,22 +31,22 @@ public class ConfigKeyringHandler extends FormHandler { } catch (DataFormatException dfe) {} if (h != null && h.getData() != null && sk.getData() != null) { _context.keyRing().put(h, sk); - addFormNotice(_("Key for") + " " + h.toBase64() + " " + _("added to keyring")); + addFormNotice(_t("Key for") + " " + h.toBase64() + " " + _t("added to keyring")); } else { - addFormError(_("Invalid destination or key")); + addFormError(_t("Invalid destination or key")); } } else { // Delete if (h != null && h.getData() != null) { if (_context.keyRing().remove(h) != null) - addFormNotice(_("Key for") + " " + h.toBase64() + " " + _("removed from keyring")); + addFormNotice(_t("Key for") + " " + h.toBase64() + " " + _t("removed from keyring")); else - addFormNotice(_("Key for") + " " + h.toBase64() + " " + _("not found in keyring")); + addFormNotice(_t("Key for") + " " + h.toBase64() + " " + _t("not found in keyring")); } else { - addFormError(_("Invalid destination")); + addFormError(_t("Invalid destination")); } } } else { - //addFormError(_("Unsupported")); + //addFormError(_t("Unsupported")); } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java index e98528a965..e902e9c72f 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHandler.java @@ -79,7 +79,7 @@ public class ConfigLoggingHandler extends FormHandler { props.setProperty(_newLogClass, _newLogLevel); _context.logManager().setLimits(props); shouldSave = true; - addFormNotice(_("Log overrides updated")); + addFormNotice(_t("Log overrides updated")); } catch (IOException ioe) { // shouldn't ever happen (BAIS shouldnt cause an IOE) _context.logManager().getLog(ConfigLoggingHandler.class).error("Error reading from the props?", ioe); @@ -160,7 +160,7 @@ public class ConfigLoggingHandler extends FormHandler { boolean saved = _context.logManager().saveConfig(); if (saved) - addFormNotice(_("Log configuration saved")); + addFormNotice(_t("Log configuration saved")); else addFormError("Error saving the configuration (applied but not saved) - please see the error logs"); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java index aa064e627d..1a9354a2d9 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigLoggingHelper.java @@ -42,9 +42,9 @@ public class ConfigLoggingHelper extends HelperBase { buf.append(prefix).append('=').append(level).append('\n'); } buf.append("
\n"); - buf.append("").append(_("Add additional logging statements above. Example: net.i2p.router.tunnel=WARN")).append("
"); - buf.append("").append(_("Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN")).append("
"); - buf.append("").append(_("Valid levels are DEBUG, INFO, WARN, ERROR, CRIT")).append("\n"); + buf.append("").append(_t("Add additional logging statements above. Example: net.i2p.router.tunnel=WARN")).append("
"); + buf.append("").append(_t("Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN")).append("
"); + buf.append("").append(_t("Valid levels are DEBUG, INFO, WARN, ERROR, CRIT")).append("\n"); /**** // this is too big and ugly @@ -78,11 +78,11 @@ public class ConfigLoggingHelper extends HelperBase { buf.append("\n"); + buf.append('>').append(_t(l)).append("\n"); } if (showRemove) - buf.append(""); + buf.append(""); buf.append("\n"); return buf.toString(); } @@ -119,7 +119,7 @@ public class ConfigLoggingHelper extends HelperBase { StringBuilder buf = new StringBuilder(65536); buf.append("
" + _("ANONYMITY WARNING - Settings include 0-hop tunnels.") + "
" + _t("ANONYMITY WARNING - Settings include 0-hop tunnels.") + "
" + _("ANONYMITY WARNING - Settings include 1-hop tunnels.") + "
" + _t("ANONYMITY WARNING - Settings include 1-hop tunnels.") + "
" + _("PERFORMANCE WARNING - Settings include very long tunnels.") + "
" + _t("PERFORMANCE WARNING - Settings include very long tunnels.") + "
" + _("PERFORMANCE WARNING - Settings include high tunnel quantities.") + "
" + _t("PERFORMANCE WARNING - Settings include high tunnel quantities.") + "
\"Inbound\"  " + _("Inbound") + "\"Outbound  " + _("Outbound") + "
\"Inbound\"  " + _t("Inbound") + "\"Outbound  " + _t("Outbound") + "
InboundOutbound
" + _("Length") + ":
" + _t("Length") + ":
" + _("Randomization") + ":
" + _t("Randomization") + ":
" + _("Quantity") + ":
" + _t("Quantity") + ":
" + _("Backup quantity") + ":
" + _t("Backup quantity") + ":
" + _("Inbound options") + ":
" + _t("Inbound options") + ":" + _("Outbound options") + ":
" + _t("Outbound options") + ":" + - _("Refresh the page to view.") + + _t("Refresh the page to view.") + ""); if (oldForceMobileConsole != _forceMobileConsole) - addFormNoticeNoEscape(_("Mobile console option saved.") + + addFormNoticeNoEscape(_t("Mobile console option saved.") + " " + - _("Refresh the page to view.") + + _t("Refresh the page to view.") + ""); } else { - addFormError(_("Error saving the configuration (applied but not saved) - please see the error logs.")); + addFormError(_t("Error saving the configuration (applied but not saved) - please see the error logs.")); } } private void addUser() { String name = getJettyString("name"); if (name == null || name.length() <= 0) { - addFormError(_("No user name entered")); + addFormError(_t("No user name entered")); return; } String pw = getJettyString("nofilter_pw"); if (pw == null || pw.length() <= 0) { - addFormError(_("No password entered")); + addFormError(_t("No password entered")); return; } ConsolePasswordManager mgr = new ConsolePasswordManager(_context); @@ -90,10 +90,10 @@ public class ConfigUIHandler extends FormHandler { if (mgr.saveMD5(RouterConsoleRunner.PROP_CONSOLE_PW, RouterConsoleRunner.JETTY_REALM, name, pw)) { if (!_context.getBooleanProperty(RouterConsoleRunner.PROP_PW_ENABLE)) _context.router().saveConfig(RouterConsoleRunner.PROP_PW_ENABLE, "true"); - addFormNotice(_("Added user {0}", name)); - addFormError(_("Restart required to take effect")); + addFormNotice(_t("Added user {0}", name)); + addFormError(_t("Restart required to take effect")); } else { - addFormError(_("Error saving the configuration (applied but not saved) - please see the error logs.")); + addFormError(_t("Error saving the configuration (applied but not saved) - please see the error logs.")); } } @@ -108,13 +108,13 @@ public class ConfigUIHandler extends FormHandler { continue; k = k.substring(7); if (mgr.remove(RouterConsoleRunner.PROP_CONSOLE_PW, k)) { - addFormNotice(_("Removed user {0}", k)); + addFormNotice(_t("Removed user {0}", k)); success = true; } else { - addFormError(_("Error saving the configuration (applied but not saved) - please see the error logs.")); + addFormError(_t("Error saving the configuration (applied but not saved) - please see the error logs.")); } } if (success) - addFormError(_("Restart required to take effect")); + addFormError(_t("Restart required to take effect")); } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java index 294cc6dc0f..1432de98b9 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUIHelper.java @@ -15,14 +15,14 @@ public class ConfigUIHelper extends HelperBase { buf.append("").append(_(theme)).append("
\n"); + buf.append("value=\"").append(theme).append("\">").append(_t(theme)).append("
\n"); } boolean universalTheming = _context.getBooleanProperty(CSSHelper.PROP_UNIVERSAL_THEMING); buf.append("") - .append(_("Set theme universally across all apps")) + .append(_t("Set theme universally across all apps")) .append("
\n"); return buf.toString(); } @@ -34,7 +34,7 @@ public class ConfigUIHelper extends HelperBase { if (forceMobileConsole) buf.append("checked=\"checked\" "); buf.append("value=\"1\">") - .append(_("Force the mobile console to be used")) + .append(_t("Force the mobile console to be used")) .append("
\n"); return buf.toString(); } @@ -163,13 +163,13 @@ public class ConfigUIHelper extends HelperBase { buf.append(""); if (userpw.isEmpty()) { buf.append(""); } else { buf.append("\n"); for (String name : userpw.keySet()) { buf.append("" + "
"); - buf.append(_("Add a user and password to enable.")); + buf.append(_t("Add a user and password to enable.")); buf.append("
") - .append(_("Remove")) + .append(_t("Remove")) .append("") - .append(_("User Name")) + .append(_t("User Name")) .append(" 
") - .append(_("Add")).append(":" + + .append(_t("Add")).append(":" + "" + ""); - buf.append(_("Password")).append(": " + + buf.append(_t("Password")).append(": " + "
\n"); return buf.toString(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java index 7f8c75dfd3..744d996835 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHandler.java @@ -157,14 +157,14 @@ public class ConfigUpdateHandler extends FormHandler { protected void processForm() { if (_action == null) return; - if (_action.equals(_("Check for updates"))) { + if (_action.equals(_t("Check for updates"))) { ConsoleUpdateManager mgr = UpdateHandler.updateManager(_context); if (mgr == null) { addFormError("Update manager not registered, cannot check"); return; } if (mgr.isUpdateInProgress() || mgr.isCheckInProgress()) { - addFormError(_("Update or check already in progress")); + addFormError(_t("Update or check already in progress")); return; } @@ -174,7 +174,7 @@ public class ConfigUpdateHandler extends FormHandler { if (shouldProxy && proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT && proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) && _context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) { - addFormError(_("HTTP client proxy tunnel must be running")); + addFormError(_t("HTTP client proxy tunnel must be running")); return; } @@ -187,19 +187,19 @@ public class ConfigUpdateHandler extends FormHandler { a3 = mgr.checkAvailable(ROUTER_UNSIGNED, 40*1000) != null; if (a1 || a2 || a3) { if ( (_updatePolicy == null) || (!_updatePolicy.equals("notify")) ) - addFormNotice(_("Update available, attempting to download now")); + addFormNotice(_t("Update available, attempting to download now")); else - addFormNotice(_("Update available, click button on left to download")); + addFormNotice(_t("Update available, click button on left to download")); // So that update() will post a status to the summary bar before we reload try { Thread.sleep(1000); } catch (InterruptedException ie) {} } else - addFormNotice(_("No update available")); + addFormNotice(_t("No update available")); return; } - if (!_action.equals(_("Save"))) + if (!_action.equals(_t("Save"))) return; Map changes = new HashMap(); @@ -213,26 +213,26 @@ public class ConfigUpdateHandler extends FormHandler { changes.put(PROP_NEWS_URL, _newsURL); // this invalidates the news changes.put(NewsHelper.PROP_LAST_CHECKED, "0"); - addFormNotice(_("Updating news URL to {0}", _newsURL)); + addFormNotice(_t("Updating news URL to {0}", _newsURL)); } else { addFormError("Changing news URL disabled"); } } } - if (_proxyHost != null && _proxyHost.length() > 0 && !_proxyHost.equals(_("internal"))) { + if (_proxyHost != null && _proxyHost.length() > 0 && !_proxyHost.equals(_t("internal"))) { String oldHost = _context.router().getConfigSetting(PROP_PROXY_HOST); if ( (oldHost == null) || (!_proxyHost.equals(oldHost)) ) { changes.put(PROP_PROXY_HOST, _proxyHost); - addFormNotice(_("Updating proxy host to {0}", _proxyHost)); + addFormNotice(_t("Updating proxy host to {0}", _proxyHost)); } } - if (_proxyPort != null && _proxyPort.length() > 0 && !_proxyPort.equals(_("internal"))) { + if (_proxyPort != null && _proxyPort.length() > 0 && !_proxyPort.equals(_t("internal"))) { String oldPort = _context.router().getConfigSetting(PROP_PROXY_PORT); if ( (oldPort == null) || (!_proxyPort.equals(oldPort)) ) { changes.put(PROP_PROXY_PORT, _proxyPort); - addFormNotice(_("Updating proxy port to {0}", _proxyPort)); + addFormNotice(_t("Updating proxy port to {0}", _proxyPort)); } } @@ -248,15 +248,15 @@ public class ConfigUpdateHandler extends FormHandler { try { oldFreq = Long.parseLong(oldFreqStr); } catch (NumberFormatException nfe) {} if (_refreshFrequency != oldFreq) { changes.put(PROP_REFRESH_FREQUENCY, ""+_refreshFrequency); - addFormNoticeNoEscape(_("Updating refresh frequency to {0}", - _refreshFrequency <= 0 ? _("Never") : DataHelper.formatDuration2(_refreshFrequency))); + addFormNoticeNoEscape(_t("Updating refresh frequency to {0}", + _refreshFrequency <= 0 ? _t("Never") : DataHelper.formatDuration2(_refreshFrequency))); } if ( (_updatePolicy != null) && (_updatePolicy.length() > 0) ) { String oldPolicy = _context.router().getConfigSetting(PROP_UPDATE_POLICY); if ( (oldPolicy == null) || (!_updatePolicy.equals(oldPolicy)) ) { changes.put(PROP_UPDATE_POLICY, _updatePolicy); - addFormNotice(_("Updating update policy to {0}", _updatePolicy)); + addFormNotice(_t("Updating update policy to {0}", _updatePolicy)); } } @@ -265,7 +265,7 @@ public class ConfigUpdateHandler extends FormHandler { String oldURL = _context.router().getConfigSetting(PROP_UPDATE_URL); if ( (oldURL == null) || (!_updateURL.equals(oldURL)) ) { changes.put(PROP_UPDATE_URL, _updateURL); - addFormNotice(_("Updating update URLs.")); + addFormNotice(_t("Updating update URLs.")); } } @@ -277,7 +277,7 @@ public class ConfigUpdateHandler extends FormHandler { // note that keys are not validated here and no console error message will be generated if (isAdvanced()) { changes.put(PROP_TRUSTED_KEYS, _trustedKeys); - addFormNotice(_("Updating trusted keys.")); + addFormNotice(_t("Updating trusted keys.")); } else { addFormError("Changing trusted keys disabled"); } @@ -289,7 +289,7 @@ public class ConfigUpdateHandler extends FormHandler { if ( (oldURL == null) || (!_zipURL.equals(oldURL)) ) { if (isAdvanced()) { changes.put(PROP_ZIP_URL, _zipURL); - addFormNotice(_("Updating unsigned update URL to {0}", _zipURL)); + addFormNotice(_t("Updating unsigned update URL to {0}", _zipURL)); } else { addFormError("Changing unsigned update URL disabled"); } @@ -301,7 +301,7 @@ public class ConfigUpdateHandler extends FormHandler { if ( (oldURL == null) || (!_devSU3URL.equals(oldURL)) ) { if (isAdvanced()) { changes.put(PROP_DEV_SU3_URL, _devSU3URL); - addFormNotice(_("Updating signed development build URL to {0}", _devSU3URL)); + addFormNotice(_t("Updating signed development build URL to {0}", _devSU3URL)); } else { addFormError("Changing signed update URL disabled"); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java index 3df84ceb5e..93644982f8 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigUpdateHelper.java @@ -51,13 +51,13 @@ public class ConfigUpdateHelper extends HelperBase { public String getProxyHost() { if (isInternal()) - return _("internal") + "\" readonly=\"readonly"; + return _t("internal") + "\" readonly=\"readonly"; return _context.getProperty(ConfigUpdateHandler.PROP_PROXY_HOST, ConfigUpdateHandler.DEFAULT_PROXY_HOST); } public String getProxyPort() { if (isInternal()) - return _("internal") + "\" readonly=\"readonly"; + return _t("internal") + "\" readonly=\"readonly"; return Integer.toString(ConfigUpdateHandler.proxyPort(_context)); } @@ -127,9 +127,9 @@ public class ConfigUpdateHelper extends HelperBase { buf.append("\" selected=\"selected"); if (PERIODS[i] == -1) - buf.append("\">").append(_("Never")).append("\n"); + buf.append("\">").append(_t("Never")).append("\n"); else - buf.append("\">").append(_("Every")).append(' ').append(DataHelper.formatDuration2(PERIODS[i])).append("\n"); + buf.append("\">").append(_t("Every")).append(' ').append(DataHelper.formatDuration2(PERIODS[i])).append("\n"); } buf.append("\n"); return buf.toString(); @@ -147,14 +147,14 @@ public class ConfigUpdateHelper extends HelperBase { buf.append(""); + buf.append('>').append(_t("Notify only")).append(""); buf.append(""); + buf.append('>').append(_t("Download and verify only")).append(""); if (_context.hasWrapper()) { buf.append(""); + buf.append('>').append(_t("Download, verify, and restart")).append(""); } buf.append("\n"); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java index 492c006e2b..f42e1cd6e2 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/EventLogHelper.java @@ -66,7 +66,7 @@ public class EventLogHelper extends FormHandler { public void setContextId(String contextId) { super.setContextId(contextId); for (int i = 0; i < _events.length; i += 2) { - _xevents.put(_events[i], _(_events[i + 1])); + _xevents.put(_events[i], _t(_events[i + 1])); } } @@ -99,27 +99,27 @@ public class EventLogHelper extends FormHandler { // So just use the "shared/console nonce". String nonce = CSSHelper.getNonce(); try { - _out.write("

" + _("Display Events") + "

"); + _out.write("

" + _t("Display Events") + "

"); _out.write("
\n" + "\n" + "\n"); - _out.write(_("Events since") + ": "); for (int i = 0; i < _times.length; i++) { writeOption(_times[i]); } _out.write("
"); - _out.write(_("Event type") + ": "); // sorted by translated display string Map events = new TreeMap(Collator.getInstance()); for (int i = 0; i < _events.length; i += 2) { events.put(_xevents.get(_events[i]), _events[i]); } - writeOption(_("All events"), ALL); + writeOption(_t("All events"), ALL); for (Map.Entry e : events.entrySet()) { writeOption(e.getKey(), e.getValue()); } _out.write("" + - "
"); + "
"); } catch (IOException ioe) { ioe.printStackTrace(); } @@ -145,7 +145,7 @@ public class EventLogHelper extends FormHandler { _out.write(" selected=\"selected\""); _out.write(">"); if (age == 0) - _out.write(_("All events")); + _out.write(_t("All events")); else _out.write(DataHelper.formatDuration2(age)); _out.write("\n"); @@ -167,21 +167,21 @@ public class EventLogHelper extends FormHandler { if (events.isEmpty()) { if (isAll) { if (_age == 0) - return _("No events found"); - return _("No events found in previous {0}", DataHelper.formatDuration2(_age)); + return _t("No events found"); + return _t("No events found in previous {0}", DataHelper.formatDuration2(_age)); } if (_age == 0) - return _("No \"{0}\" events found", xev); - return _("No \"{0}\" events found in previous {1}", xev, DataHelper.formatDuration2(_age)); + return _t("No \"{0}\" events found", xev); + return _t("No \"{0}\" events found in previous {1}", xev, DataHelper.formatDuration2(_age)); } StringBuilder buf = new StringBuilder(2048); buf.append("
"); - buf.append(_("Time")); + buf.append(_t("Time")); buf.append(""); if (isAll) { - buf.append(_("Event")); + buf.append(_t("Event")); buf.append(""); - buf.append(_("Details")); + buf.append(_t("Details")); } else { buf.append(xev); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java index a56f8f7ad1..1b2dabb3a7 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/FormHandler.java @@ -248,9 +248,9 @@ public abstract class FormHandler { } if (!_nonce.equals(_nonce1) && !_nonce.equals(_nonce2)) { - addFormError(_("Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.") + addFormError(_t("Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.") + ' ' + - _("If the problem persists, verify that you have cookies enabled in your browser.")); + _t("If the problem persists, verify that you have cookies enabled in your browser.")); _valid = false; } } @@ -291,28 +291,28 @@ public abstract class FormHandler { } /** translate a string */ - public String _(String s) { + public String _t(String s) { return Messages.getString(s, _context); } /** * translate a string with a parameter - * This is a lot more expensive than _(s), so use sparingly. + * This is a lot more expensive than _t(s), so use sparingly. * * @param s string to be translated containing {0} * The {0} will be replaced by the parameter. * Single quotes must be doubled, i.e. ' -> '' in the string. * @param o parameter, not translated. - * To tranlslate parameter also, use _("foo {0} bar", _("baz")) + * To tranlslate parameter also, use _t("foo {0} bar", _t("baz")) * Do not double the single quotes in the parameter. * Use autoboxing to call with ints, longs, floats, etc. */ - public String _(String s, Object o) { + public String _t(String s, Object o) { return Messages.getString(s, o, _context); } /** two params @since 0.8.2 */ - public String _(String s, Object o, Object o2) { + public String _t(String s, Object o, Object o2) { return Messages.getString(s, o, o2, _context); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java index eff8dc3e36..ab35a104a4 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/GraphHelper.java @@ -159,7 +159,7 @@ public class GraphHelper extends FormHandler { + "&w=" + (3 * _width) + "&h=" + (3 * _height) + "\">"); - String title = _("Combined bandwidth graph"); + String title = _t("Combined bandwidth graph"); _out.write("" + _("All times are UTC.") + "

\n"); + //_out.write("

" + _t("All times are UTC.") + "

\n"); } catch (IOException ioe) { ioe.printStackTrace(); } @@ -220,7 +220,7 @@ public class GraphHelper extends FormHandler { if (_stat.equals("bw.combined")) { period = 60000; name = _stat; - displayName = _("Bandwidth usage"); + displayName = _t("Bandwidth usage"); } else { Set rates = StatSummarizer.instance().parseSpecs(_stat); if (rates.size() != 1) { @@ -233,9 +233,9 @@ public class GraphHelper extends FormHandler { displayName = name; } _out.write("

"); - _out.write(_("{0} for {1}", displayName, DataHelper.formatDuration2(_periodCount * period))); + _out.write(_t("{0} for {1}", displayName, DataHelper.formatDuration2(_periodCount * period))); if (_end > 0) - _out.write(' ' + _("ending {0} ago", DataHelper.formatDuration2(_end * period))); + _out.write(' ' + _t("ending {0} ago", DataHelper.formatDuration2(_end * period))); _out.write("

- "); } if (_width > MIN_X && _height > MIN_Y) { _out.write(link(_stat, _showEvents, _periodCount, _end, _width * 2 / 3, _height * 2 / 3)); - _out.write(_("Smaller")); + _out.write(_t("Smaller")); _out.write(" - "); } if (_height < MAX_Y) { _out.write(link(_stat, _showEvents, _periodCount, _end, _width, _height * 3 / 2)); - _out.write(_("Taller")); + _out.write(_t("Taller")); _out.write(" - "); } if (_height > MIN_Y) { _out.write(link(_stat, _showEvents, _periodCount, _end, _width, _height * 2 / 3)); - _out.write(_("Shorter")); + _out.write(_t("Shorter")); _out.write(" - "); } if (_width < MAX_X) { _out.write(link(_stat, _showEvents, _periodCount, _end, _width * 3 / 2, _height)); - _out.write(_("Wider")); + _out.write(_t("Wider")); _out.write(" - "); } if (_width > MIN_X) { _out.write(link(_stat, _showEvents, _periodCount, _end, _width * 2 / 3, _height)); - _out.write(_("Narrower")); + _out.write(_t("Narrower")); _out.write(""); } _out.write("
"); if (_periodCount < MAX_C) { _out.write(link(_stat, _showEvents, _periodCount * 2, _end, _width, _height)); - _out.write(_("Larger interval")); + _out.write(_t("Larger interval")); _out.write(" - "); } if (_periodCount > MIN_C) { _out.write(link(_stat, _showEvents, _periodCount / 2, _end, _width, _height)); - _out.write(_("Smaller interval")); + _out.write(_t("Smaller interval")); _out.write(""); } _out.write("
"); if (_periodCount < MAX_C) { _out.write(link(_stat, _showEvents, _periodCount, _end + _periodCount, _width, _height)); - _out.write(_("Previous interval")); + _out.write(_t("Previous interval")); _out.write(""); } @@ -311,17 +311,17 @@ public class GraphHelper extends FormHandler { if (_periodCount < MAX_C) _out.write(" - "); _out.write(link(_stat, _showEvents, _periodCount, end, _width, _height)); - _out.write(_("Next interval")); + _out.write(_t("Next interval")); _out.write(" "); } _out.write("
"); _out.write(link(_stat, !_showEvents, _periodCount, _end, _width, _height)); if (!_stat.equals("bw.combined")) - _out.write(_showEvents ? _("Plot averages") : _("plot events")); + _out.write(_showEvents ? _t("Plot averages") : _t("plot events")); _out.write(""); - _out.write("

" + _("All times are UTC.") + "

\n"); + _out.write("

" + _t("All times are UTC.") + "

\n"); } catch (IOException ioe) { ioe.printStackTrace(); } @@ -353,17 +353,17 @@ public class GraphHelper extends FormHandler { // So just use the "shared/console nonce". String nonce = CSSHelper.getNonce(); try { - _out.write("

" + _("Configure Graph Display") + " [" + _("Select Stats") + "]

"); + _out.write("

" + _t("Configure Graph Display") + " [" + _t("Select Stats") + "]

"); _out.write("
\n" + "\n" + "\n"); - _out.write(_("Periods") + ":
\n"); - _out.write(_("Plot averages") + ": "); - _out.write(_("or")+ " " +_("plot events") + ":
\n"); - _out.write(_("Image sizes") + ": " + _("width") + ": " + _("pixels") + ", " + _("height") + ": " + _("pixels") + "
\n"); - _out.write(_("Refresh delay") + ":
\n"); + _out.write(_t("Plot averages") + ": "); + _out.write(_t("or")+ " " +_t("plot events") + ":
\n"); + _out.write(_t("Image sizes") + ": " + _t("width") + ": " + _t("pixels") + ", " + _t("height") + ": " + _t("pixels") + "
\n"); + _out.write(_t("Refresh delay") + ":
\n" + - _("Store graph data on disk?") + + _t("Store graph data on disk?") + " " + - "
"); + "
"); } catch (IOException ioe) { ioe.printStackTrace(); } @@ -440,7 +440,7 @@ public class GraphHelper extends FormHandler { changes.put(PROP_EVENTS, "" + _showEvents); changes.put(SummaryListener.PROP_PERSISTENT, "" + _persistent); _context.router().saveConfig(changes, null); - addFormNotice(_("Graph settings saved")); + addFormNotice(_t("Graph settings saved")); } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/HelperBase.java b/apps/routerconsole/java/src/net/i2p/router/web/HelperBase.java index ff0dc80592..1c14848dcf 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/HelperBase.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/HelperBase.java @@ -44,28 +44,28 @@ public abstract class HelperBase { public void storeWriter(Writer out) { _out = out; } /** translate a string */ - public String _(String s) { + public String _t(String s) { return Messages.getString(s, _context); } /** * translate a string with a parameter - * This is a lot more expensive than _(s), so use sparingly. + * This is a lot more expensive than _t(s), so use sparingly. * * @param s string to be translated containing {0} * The {0} will be replaced by the parameter. * Single quotes must be doubled, i.e. ' -> '' in the string. * @param o parameter, not translated. - * To tranlslate parameter also, use _("foo {0} bar", _("baz")) + * To tranlslate parameter also, use _t("foo {0} bar", _t("baz")) * Do not double the single quotes in the parameter. * Use autoboxing to call with ints, longs, floats, etc. */ - public String _(String s, Object o) { + public String _t(String s, Object o) { return Messages.getString(s, o, _context); } /** two params @since 0.7.14 */ - public String _(String s, Object o, Object o2) { + public String _t(String s, Object o, Object o2) { return Messages.getString(s, o, o2, _context); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/HomeHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/HomeHelper.java index 8f2b482666..d9a8de3011 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/HomeHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/HomeHelper.java @@ -105,9 +105,9 @@ public class HomeHelper extends HelperBase { public String getProxyStatus() { int port = _context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY); if (port <= 0) - return _("The HTTP proxy is not up"); + return _t("The HTTP proxy is not up"); return "\"""; } @@ -168,7 +168,7 @@ public class HomeHelper extends HelperBase { } private String renderApps(Collection apps) { - String website = _("Website"); + String website = _t("Website"); StringBuilder buf = new StringBuilder(1024); buf.append("
"); for (App app : apps) { @@ -205,11 +205,11 @@ public class HomeHelper extends HelperBase { private String renderConfig(Collection apps) { StringBuilder buf = new StringBuilder(1024); buf.append("\n"); for (App app : apps) { buf.append("\n"); } buf.append("" + ""); buf.append("
") - .append(_("Remove")) + .append(_t("Remove")) .append("") - .append(_("Name")) + .append(_t("Name")) .append("") - .append(_("URL")) + .append(_t("URL")) .append("
") - .append(_("Add")).append(":" + + .append(_t("Add")).append(":" + "
\n"); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java index e6dc09a201..7bc28287fb 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/JobQueueHelper.java @@ -47,29 +47,29 @@ public class JobQueueHelper extends HelperBase { int numRunners = _context.jobQueue().getJobs(readyJobs, timedJobs, activeJobs, justFinishedJobs); StringBuilder buf = new StringBuilder(32*1024); - buf.append("

").append(_("I2P Job Queue")).append("


") - .append(_("Job runners")).append(": ").append(numRunners) + buf.append("

").append(_t("I2P Job Queue")).append("


") + .append(_t("Job runners")).append(": ").append(numRunners) .append("
\n"); long now = _context.clock().now(); - buf.append("
").append(_("Active jobs")).append(": ").append(activeJobs.size()).append("
    \n"); + buf.append("
    ").append(_t("Active jobs")).append(": ").append(activeJobs.size()).append("
      \n"); for (int i = 0; i < activeJobs.size(); i++) { Job j = activeJobs.get(i); - buf.append("
    1. (").append(_("started {0} ago", DataHelper.formatDuration2(now-j.getTiming().getStartAfter()))).append("): "); + buf.append("
    2. (").append(_t("started {0} ago", DataHelper.formatDuration2(now-j.getTiming().getStartAfter()))).append("): "); buf.append(j.toString()).append("
    3. \n"); } buf.append("
    \n"); - buf.append("
    ").append(_("Just finished jobs")).append(": ").append(justFinishedJobs.size()).append("
      \n"); + buf.append("
      ").append(_t("Just finished jobs")).append(": ").append(justFinishedJobs.size()).append("
        \n"); for (int i = 0; i < justFinishedJobs.size(); i++) { Job j = justFinishedJobs.get(i); - buf.append("
      1. (").append(_("finished {0} ago", DataHelper.formatDuration2(now-j.getTiming().getActualEnd()))).append("): "); + buf.append("
      2. (").append(_t("finished {0} ago", DataHelper.formatDuration2(now-j.getTiming().getActualEnd()))).append("): "); buf.append(j.toString()).append("
      3. \n"); } buf.append("
      \n"); - buf.append("
      ").append(_("Ready/waiting jobs")).append(": ").append(readyJobs.size()).append("
        \n"); + buf.append("
        ").append(_t("Ready/waiting jobs")).append(": ").append(readyJobs.size()).append("
          \n"); ObjectCounter counter = new ObjectCounter(); for (int i = 0; i < readyJobs.size(); i++) { Job j = readyJobs.get(i); @@ -86,7 +86,7 @@ public class JobQueueHelper extends HelperBase { out.write(buf.toString()); buf.setLength(0); - buf.append("
          ").append(_("Scheduled jobs")).append(": ").append(timedJobs.size()).append("
            \n"); + buf.append("
            ").append(_t("Scheduled jobs")).append(": ").append(timedJobs.size()).append("
              \n"); long prev = Long.MIN_VALUE; counter.clear(); for (int i = 0; i < timedJobs.size(); i++) { @@ -96,7 +96,7 @@ public class JobQueueHelper extends HelperBase { continue; long time = j.getTiming().getStartAfter() - now; // translators: {0} is a job name, {1} is a time, e.g. 6 min - buf.append("
            1. ").append(_("{0} will start in {1}", j.getName(), DataHelper.formatDuration2(time))); + buf.append("
            2. ").append(_t("{0} will start in {1}", j.getName(), DataHelper.formatDuration2(time))); // debug, don't bother translating if (time < 0) buf.append(" DELAYED"); @@ -110,7 +110,7 @@ public class JobQueueHelper extends HelperBase { out.write(buf.toString()); buf.setLength(0); - buf.append("
              ").append(_("Total Job Statistics")).append("\n"); + buf.append("
              ").append(_t("Total Job Statistics")).append("\n"); getJobStats(buf); out.write(buf.toString()); } @@ -121,7 +121,7 @@ public class JobQueueHelper extends HelperBase { if (names.size() < 4) return; buf.append("\n" + - "
              ").append(_("Job")).append("").append(_("Queued")).append(""); + "
              ").append(_t("Job")).append("").append(_t("Queued")).append(""); Collections.sort(names, new JobCountComparator(counter)); for (String name : names) { buf.append("
              ").append(name) @@ -138,12 +138,12 @@ public class JobQueueHelper extends HelperBase { */ private void getJobStats(StringBuilder buf) { buf.append("\n" + - "" + - "" + - "" + - "\n"); + "" + + "" + + "" + + "\n"); long totRuns = 0; long totDropped = 0; long totExecTime = 0; @@ -194,7 +194,7 @@ public class JobQueueHelper extends HelperBase { } buf.append(""); - buf.append(""); + buf.append(""); buf.append(""); buf.append(""); buf.append(""); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java index e3845df9da..dbed0c82e7 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/LogsHelper.java @@ -46,7 +46,7 @@ public class LogsHelper extends HelperBase { */ public String getLogs() { String str = formatMessages(_context.logManager().getBuffer().getMostRecentMessages()); - return "

              " + _("File location") + ": " + _context.logManager().currentFile() + "

              " + str; + return "

              " + _t("File location") + ": " + _context.logManager().currentFile() + "

              " + str; } /** @@ -97,10 +97,10 @@ public class LogsHelper extends HelperBase { str = FileUtil.readTextFile(f.getAbsolutePath(), 250, false); } if (str == null) { - return "

              " + _("File not found") + ": " + f.getAbsolutePath() + "

              "; + return "

              " + _t("File not found") + ": " + f.getAbsolutePath() + "

              "; } else { str = str.replace("&", "&").replace("<", "<").replace(">", ">"); - return "

              " + _("File location") + ": " + f.getAbsolutePath() + "

              " + str + "
              "; + return "

              " + _t("File location") + ": " + f.getAbsolutePath() + "

              " + str + "
              "; } } @@ -115,7 +115,7 @@ public class LogsHelper extends HelperBase { /** formats in reverse order */ private String formatMessages(List msgs) { if (msgs.isEmpty()) - return "

              " + _("No log messages") + "

              "; + return "

              " + _t("No log messages") + "

              "; boolean colorize = _context.getBooleanPropertyDefaultTrue("routerconsole.logs.color"); StringBuilder buf = new StringBuilder(16*1024); buf.append("
                "); @@ -138,13 +138,13 @@ public class LogsHelper extends HelperBase { // Homeland Security Advisory System // http://www.dhs.gov/xinfoshare/programs/Copy_of_press_release_0046.shtm // but pink instead of yellow for WARN - if (msg.contains(_("CRIT"))) + if (msg.contains(_t("CRIT"))) color = "#cc0000"; - else if (msg.contains(_("ERROR"))) + else if (msg.contains(_t("ERROR"))) color = "#ff3300"; - else if (msg.contains(_("WARN"))) + else if (msg.contains(_t("WARN"))) color = "#ff00cc"; - else if (msg.contains(_("INFO"))) + else if (msg.contains(_t("INFO"))) color = "#000099"; else color = "#006600"; diff --git a/apps/routerconsole/java/src/net/i2p/router/web/Messages.java b/apps/routerconsole/java/src/net/i2p/router/web/Messages.java index c76f260e8d..e138c0ffde 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/Messages.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/Messages.java @@ -24,7 +24,7 @@ public class Messages extends Translate { * The {0} will be replaced by the parameter. * Single quotes must be doubled, i.e. ' -> '' in the string. * @param o parameter, not translated. - * To tranlslate parameter also, use _("foo {0} bar", _("baz")) + * To tranlslate parameter also, use _t("foo {0} bar", _t("baz")) * Do not double the single quotes in the parameter. * Use autoboxing to call with ints, longs, floats, etc. */ diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NetDbHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/NetDbHelper.java index 496f49ac14..808297fb53 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NetDbHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NetDbHelper.java @@ -125,12 +125,12 @@ public class NetDbHelper extends HelperBase { // we are there if (span) buf.append(""); - buf.append(_(titles[i])); + buf.append(_t(titles[i])); } else { // we are not there, make a link if (span) buf.append(""); - buf.append("").append(_(titles[i])).append(""); + buf.append("").append(_t(titles[i])).append(""); } if (span) buf.append(" \n"); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java index 89b4a7000e..e0340f68a0 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/NetDbRenderer.java @@ -102,14 +102,14 @@ public class NetDbRenderer { } } if (notFound) { - buf.append(_("Router")).append(' '); + buf.append(_t("Router")).append(' '); if (routerPrefix != null) buf.append(routerPrefix); else if (version != null) buf.append(version); else if (country != null) buf.append(country); - buf.append(' ').append(_("not found in network database")); + buf.append(' ').append(_t("not found in network database")); } } out.write(buf.toString()); @@ -153,12 +153,12 @@ public class NetDbRenderer { for (LeaseSet ls : leases) { Destination dest = ls.getDestination(); Hash key = dest.calculateHash(); - buf.append("").append(_("LeaseSet")).append(": ").append(key.toBase64()).append("\n"); + buf.append("").append(_t("LeaseSet")).append(": ").append(key.toBase64()).append("\n"); if (_context.clientManager().isLocal(dest)) { - buf.append(" (" + _("Local") + " "); + buf.append(" (" + _t("Local") + " "); if (! _context.clientManager().shouldPublishLeaseSet(key)) - buf.append(_("Unpublished") + ' '); - buf.append(_("Destination") + ' '); + buf.append(_t("Unpublished") + ' '); + buf.append(_t("Destination") + ' '); TunnelPoolSettings in = _context.tunnelManager().getInboundSettings(key); if (in != null && in.getDestinationNickname() != null) buf.append(in.getDestinationNickname()); @@ -170,10 +170,10 @@ public class NetDbRenderer { String host = _context.namingService().reverseLookup(dest); if (host == null) { buf.append("").append(_("Add to local addressbook")).append("
                \n"); + .append(dest.toBase64()).append("#add\">").append(_t("Add to local addressbook")).append("
                \n"); } } else { - buf.append(" (").append(_("Destination")).append(' '); + buf.append(" (").append(_t("Destination")).append(' '); String host = _context.namingService().reverseLookup(dest); if (host != null) { buf.append("").append(host).append(")
                \n"); @@ -182,14 +182,14 @@ public class NetDbRenderer { buf.append(dest.toBase64().substring(0, 6)).append(")
                \n" + "").append(b32).append("
                \n" + "").append(_("Add to local addressbook")).append("
                \n"); + .append(dest.toBase64()).append("#add\">").append(_t("Add to local addressbook")).append("
                \n"); } } long exp = ls.getLatestLeaseDate()-now; if (exp > 0) - buf.append(_("Expires in {0}", DataHelper.formatDuration2(exp))); + buf.append(_t("Expires in {0}", DataHelper.formatDuration2(exp))); else - buf.append(_("Expired {0} ago", DataHelper.formatDuration2(0-exp))); + buf.append(_t("Expired {0} ago", DataHelper.formatDuration2(0-exp))); buf.append("
                \n"); if (debug) { buf.append("RAP? " + ls.getReceivedAsPublished()); @@ -208,15 +208,15 @@ public class NetDbRenderer { } for (int i = 0; i < ls.getLeaseCount(); i++) { Lease lease = ls.getLease(i); - buf.append(_("Lease")).append(' ').append(i + 1).append(": ").append(_("Gateway")).append(' '); + buf.append(_t("Lease")).append(' ').append(i + 1).append(": ").append(_t("Gateway")).append(' '); buf.append(_context.commSystem().renderPeerHTML(lease.getGateway())); - buf.append(' ').append(_("Tunnel")).append(' ').append(lease.getTunnelId().getTunnelId()).append(' '); + buf.append(' ').append(_t("Tunnel")).append(' ').append(lease.getTunnelId().getTunnelId()).append(' '); if (debug) { long exl = lease.getEndDate().getTime() - now; if (exl > 0) - buf.append(_("Expires in {0}", DataHelper.formatDuration2(exl))); + buf.append(_t("Expires in {0}", DataHelper.formatDuration2(exl))); else - buf.append(_("Expired {0} ago", DataHelper.formatDuration2(0-exl))); + buf.append(_t("Expired {0} ago", DataHelper.formatDuration2(0-exl))); } buf.append("
                \n"); } @@ -277,7 +277,7 @@ public class NetDbRenderer { */ public void renderStatusHTML(Writer out, int mode) throws IOException { if (!_context.netDb().isInitialized()) { - out.write(_("Not initialized")); + out.write(_t("Not initialized")); out.flush(); return; } @@ -327,14 +327,14 @@ public class NetDbRenderer { // the summary table buf.append("
              ").append(_("Job")).append("").append(_("Runs")).append("").append(_("Dropped")).append("").append(_("Time")).append("").append(_("Avg")).append("") - .append(_("Max")).append("").append(_("Min")).append("").append(_("Pending")).append("").append(_("Avg")).append("") - .append(_("Max")).append("").append(_("Min")).append("
              ").append(_t("Job")).append("").append(_t("Runs")).append("").append(_t("Dropped")).append("").append(_t("Time")).append("").append(_t("Avg")).append("") + .append(_t("Max")).append("").append(_t("Min")).append("").append(_t("Pending")).append("").append(_t("Avg")).append("") + .append(_t("Max")).append("").append(_t("Min")).append("
              ").append(_("Summary")).append("").append(_t("Summary")).append("").append(totRuns).append("").append(totDropped).append("").append(DataHelper.formatDuration2(totExecTime)).append("
              ") - .append(_("Network Database Router Statistics")) + .append(_t("Network Database Router Statistics")) .append("
              "); // versions table List versionList = new ArrayList(versions.objects()); if (!versionList.isEmpty()) { Collections.sort(versionList, Collections.reverseOrder(new VersionComparator())); buf.append("\n"); - buf.append("\n"); + buf.append("\n"); for (String routerVersion : versionList) { int num = versions.count(routerVersion); String ver = DataHelper.stripHTML(routerVersion); @@ -349,11 +349,11 @@ public class NetDbRenderer { // transports table buf.append("
              " + _("Version") + "" + _("Count") + "
              " + _t("Version") + "" + _t("Count") + "
              \n"); - buf.append("\n"); + buf.append("\n"); for (int i = 0; i < TNAMES.length; i++) { int num = transportCount[i]; if (num > 0) { - buf.append("\n"); } } @@ -367,7 +367,7 @@ public class NetDbRenderer { if (!countryList.isEmpty()) { Collections.sort(countryList, new CountryComparator()); buf.append("
              " + _("Transports") + "" + _("Count") + "
              " + _t("Transports") + "" + _t("Count") + "
              ").append(_(TNAMES[i])); + buf.append("
              ").append(_t(TNAMES[i])); buf.append("").append(num).append("
              \n"); - buf.append("\n"); + buf.append("\n"); for (String country : countryList) { int num = countries.count(country); buf.append("\n"); if (full) { - buf.append("
              " + _("Country") + "" + _("Count") + "
              " + _t("Country") + "" + _t("Count") + "
              \"").append(country.toUpperCase(Locale.US)).append("\"");
              "); if (isUs) { - buf.append("" + _("Our info") + ": ").append(hash).append("
              \n"); + buf.append("" + _t("Our info") + ": ").append(hash).append("
              \n"); } else { - buf.append("" + _("Peer info for") + ": ").append(hash).append("\n"); + buf.append("" + _t("Peer info for") + ": ").append(hash).append("\n"); if (!full) { - buf.append("[").append(_("Full entry")).append("]"); + buf.append("[").append(_t("Full entry")).append("]"); } buf.append("
              \n"); } long age = _context.clock().now() - info.getPublished(); if (isUs && _context.router().isHidden()) { - buf.append("").append(_("Hidden")).append(", ").append(_("Updated")).append(": ") - .append(_("{0} ago", DataHelper.formatDuration2(age))).append("
              \n"); + buf.append("").append(_t("Hidden")).append(", ").append(_t("Updated")).append(": ") + .append(_t("{0} ago", DataHelper.formatDuration2(age))).append("
              \n"); } else if (age > 0) { - buf.append("").append(_("Published")).append(": ") - .append(_("{0} ago", DataHelper.formatDuration2(age))).append("
              \n"); + buf.append("").append(_t("Published")).append(": ") + .append(_t("{0} ago", DataHelper.formatDuration2(age))).append("
              \n"); } else { // shouldnt happen - buf.append("" + _("Published") + ": in ").append(DataHelper.formatDuration2(0-age)).append("???
              \n"); + buf.append("" + _t("Published") + ": in ").append(DataHelper.formatDuration2(0-age)).append("???
              \n"); } - buf.append("").append(_("Signing Key")).append(": ") + buf.append("").append(_t("Signing Key")).append(": ") .append(info.getIdentity().getSigningPublicKey().getType().toString()); - buf.append("
              \n" + _("Address(es)") + ": "); + buf.append("
              \n" + _t("Address(es)") + ": "); String country = _context.commSystem().getCountry(info.getIdentity().getHash()); if(country != null) { buf.append("\"").append(country.toUpperCase(Locale.US)).append('\"');").append(DataHelper.stripHTML(style)).append(": "); int cost = addr.getCost(); if (!((style.equals("SSU") && cost == 5) || (style.equals("NTCP") && cost == 10))) - buf.append('[').append(_("cost")).append('=').append("" + cost).append("] "); + buf.append('[').append(_t("cost")).append('=').append("" + cost).append("] "); Map p = addr.getOptionsMap(); for (Map.Entry e : p.entrySet()) { String name = (String) e.getKey(); String val = (String) e.getValue(); - buf.append('[').append(_(DataHelper.stripHTML(name))).append('=').append(DataHelper.stripHTML(val)).append("] "); + buf.append('[').append(_t(DataHelper.stripHTML(name))).append('=').append(DataHelper.stripHTML(val)).append("] "); } } buf.append("
              " + _("Stats") + ":
              "); + buf.append("
              " + _t("Stats") + ":
              "); Map p = info.getOptionsMap(); for (Map.Entry e : p.entrySet()) { String key = (String) e.getKey(); @@ -514,7 +514,7 @@ public class NetDbRenderer { } /** translate a string */ - private String _(String s) { + private String _t(String s) { return Messages.getString(s, _context); } @@ -525,17 +525,17 @@ public class NetDbRenderer { /** * translate a string with a parameter - * This is a lot more expensive than _(s), so use sparingly. + * This is a lot more expensive than _t(s), so use sparingly. * * @param s string to be translated containing {0} * The {0} will be replaced by the parameter. * Single quotes must be doubled, i.e. ' -> '' in the string. * @param o parameter, not translated. - * To tranlslate parameter also, use _("foo {0} bar", _("baz")) + * To tranlslate parameter also, use _t("foo {0} bar", _t("baz")) * Do not double the single quotes in the parameter. * Use autoboxing to call with ints, longs, floats, etc. */ - private String _(String s, Object o) { + private String _t(String s, Object o) { return Messages.getString(s, o, _context); } } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java index ef70b170ae..2cb7e311f2 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ProfileOrganizerRenderer.java @@ -75,7 +75,7 @@ class ProfileOrganizerRenderer { //// if (mode < 2) { - //buf.append("

              ").append(_("Peer Profiles")).append("

              \n

              "); + //buf.append("

              ").append(_t("Peer Profiles")).append("

              \n

              "); buf.append(ngettext("Showing 1 recent profile.", "Showing {0} recent profiles.", order.size())).append('\n'); if (older > 0) buf.append(ngettext("Hiding 1 older profile.", "Hiding {0} older profiles.", older)).append('\n'); @@ -84,12 +84,12 @@ class ProfileOrganizerRenderer { buf.append("

              "); buf.append(""); buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); buf.append(""); buf.append(""); int prevTier = 1; @@ -127,12 +127,12 @@ class ProfileOrganizerRenderer { buf.append(""); //buf.append("\n"); buf.append(""); // let's not build the whole page in memory (~500 bytes per peer) @@ -193,26 +193,26 @@ class ProfileOrganizerRenderer { //// } else { - //buf.append("

              ").append(_("Floodfill and Integrated Peers")) + //buf.append("

              ").append(_t("Floodfill and Integrated Peers")) // .append(" (").append(integratedPeers.size()).append(")

              \n"); buf.append("
              ").append(_("Peer")).append("").append(_("Groups (Caps)")).append("").append(_("Speed")).append("").append(_("Capacity")).append("").append(_("Integration")).append("").append(_("Status")).append("").append(_t("Peer")).append("").append(_t("Groups (Caps)")).append("").append(_t("Speed")).append("").append(_t("Capacity")).append("").append(_t("Integration")).append("").append(_t("Status")).append(" 
              "); switch (tier) { - case 1: buf.append(_("Fast, High Capacity")); break; - case 2: buf.append(_("High Capacity")); break; - case 3: buf.append(_("Standard")); break; - default: buf.append(_("Failing")); break; + case 1: buf.append(_t("Fast, High Capacity")); break; + case 2: buf.append(_t("High Capacity")); break; + case 3: buf.append(_t("Standard")); break; + default: buf.append(_t("Failing")); break; } - if (isIntegrated) buf.append(", ").append(_("Integrated")); + if (isIntegrated) buf.append(", ").append(_t("Integrated")); RouterInfo info = _context.netDb().lookupRouterInfoLocally(peer); if (info != null) { // prevent HTML injection in the caps and version @@ -163,9 +163,9 @@ class ProfileOrganizerRenderer { } buf.append("").append(num(prof.getIntegrationValue())); buf.append(""); - if (_context.banlist().isBanlisted(peer)) buf.append(_("Banned")); - if (prof.getIsFailing()) buf.append(' ').append(_("Failing")); - if (_context.commSystem().wasUnreachable(peer)) buf.append(' ').append(_("Unreachable")); + if (_context.banlist().isBanlisted(peer)) buf.append(_t("Banned")); + if (prof.getIsFailing()) buf.append(' ').append(_t("Failing")); + if (_context.commSystem().wasUnreachable(peer)) buf.append(' ').append(_t("Unreachable")); RateAverages ra = RateAverages.getTemp(); Rate failed = prof.getTunnelHistory().getFailedRate().getRate(30*60*1000); long fails = failed.computeAverages(ra, false).getTotalEventCount(); @@ -173,13 +173,13 @@ class ProfileOrganizerRenderer { Rate accepted = prof.getTunnelCreateResponseTime().getRate(30*60*1000); long total = fails + accepted.computeAverages(ra, false).getTotalEventCount(); if (total / fails <= 10) // hide if < 10% - buf.append(' ').append(fails).append('/').append(total).append(' ').append(_("Test Fails")); + buf.append(' ').append(fails).append('/').append(total).append(' ').append(_t("Test Fails")); } buf.append(" ").append(_("profile")).append(""); + // .append(peer.toBase64().substring(0,6)).append("\">").append(_t("profile")).append(""); buf.append("").append(_("profile")).append(""); + .append(peer.toBase64()).append("\">").append(_t("profile")).append(""); buf.append(" +-
              "); buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); - buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); + buf.append(""); buf.append(""); RateAverages ra = RateAverages.getTemp(); for (PeerProfile prof : order) { @@ -244,7 +244,7 @@ class ProfileOrganizerRenderer { buf.append(""); } else { for (int i = 0; i < 6; i++) - buf.append("\n"); } @@ -256,20 +256,20 @@ class ProfileOrganizerRenderer { } if (mode < 2) { - buf.append("

              ").append(_("Thresholds")).append("

              "); - buf.append("

              ").append(_("Speed")).append(": ").append(num(_organizer.getSpeedThreshold())) - .append(" (").append(fast).append(' ').append(_("fast peers")).append(")
              "); - buf.append("").append(_("Capacity")).append(": ").append(num(_organizer.getCapacityThreshold())) - .append(" (").append(reliable).append(' ').append(_("high capacity peers")).append(")
              "); - buf.append("").append(_("Integration")).append(": ").append(num(_organizer.getIntegrationThreshold())) - .append(" (").append(integrated).append(' ').append(_(" well integrated peers")).append(")

              "); - buf.append("

              ").append(_("Definitions")).append("

                "); - buf.append("
              • ").append(_("groups")).append(": ").append(_("as determined by the profile organizer")).append("
              • "); - buf.append("
              • ").append(_("caps")).append(": ").append(_("capabilities in the netDb, not used to determine profiles")).append("
              • "); - buf.append("
              • ").append(_("speed")).append(": ").append(_("peak throughput (bytes per second) over a 1 minute period that the peer has sustained in a single tunnel")).append("
              • "); - buf.append("
              • ").append(_("capacity")).append(": ").append(_("how many tunnels can we ask them to join in an hour?")).append("
              • "); - buf.append("
              • ").append(_("integration")).append(": ").append(_("how many new peers have they told us about lately?")).append("
              • "); - buf.append("
              • ").append(_("status")).append(": ").append(_("is the peer banned, or unreachable, or failing tunnel tests?")).append("
              • "); + buf.append("

                ").append(_t("Thresholds")).append("

                "); + buf.append("

                ").append(_t("Speed")).append(": ").append(num(_organizer.getSpeedThreshold())) + .append(" (").append(fast).append(' ').append(_t("fast peers")).append(")
                "); + buf.append("").append(_t("Capacity")).append(": ").append(num(_organizer.getCapacityThreshold())) + .append(" (").append(reliable).append(' ').append(_t("high capacity peers")).append(")
                "); + buf.append("").append(_t("Integration")).append(": ").append(num(_organizer.getIntegrationThreshold())) + .append(" (").append(integrated).append(' ').append(_t(" well integrated peers")).append(")

                "); + buf.append("

                ").append(_t("Definitions")).append("

                  "); + buf.append("
                • ").append(_t("groups")).append(": ").append(_t("as determined by the profile organizer")).append("
                • "); + buf.append("
                • ").append(_t("caps")).append(": ").append(_t("capabilities in the netDb, not used to determine profiles")).append("
                • "); + buf.append("
                • ").append(_t("speed")).append(": ").append(_t("peak throughput (bytes per second) over a 1 minute period that the peer has sustained in a single tunnel")).append("
                • "); + buf.append("
                • ").append(_t("capacity")).append(": ").append(_t("how many tunnels can we ask them to join in an hour?")).append("
                • "); + buf.append("
                • ").append(_t("integration")).append(": ").append(_t("how many new peers have they told us about lately?")).append("
                • "); + buf.append("
                • ").append(_t("status")).append(": ").append(_t("is the peer banned, or unreachable, or failing tunnel tests?")).append("
                • "); buf.append("
                "); //// @@ -336,13 +336,13 @@ class ProfileOrganizerRenderer { private String avg (PeerProfile prof, long rate, RateAverages ra) { RateStat rs = prof.getDbResponseTime(); if (rs == null) - return _(NA); + return _t(NA); Rate r = rs.getRate(rate); if (r == null) - return _(NA); + return _t(NA); r.computeAverages(ra, false); if (ra.getTotalEventCount() == 0) - return _(NA); + return _t(NA); return DataHelper.formatDuration2(Math.round(ra.getAverage())); } @@ -363,12 +363,12 @@ class ProfileOrganizerRenderer { /** @since 0.9.21 */ private String formatInterval(long now, long then) { if (then <= 0) - return _(NA); + return _t(NA); return DataHelper.formatDuration2(now - then); } /** translate a string */ - private String _(String s) { + private String _t(String s) { return Messages.getString(s, _context); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java index 6645558d5d..3236d1f126 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ProfilesHelper.java @@ -104,12 +104,12 @@ public class ProfilesHelper extends HelperBase { // we are there if (span) buf.append(""); - buf.append(_(titles[i])); + buf.append(_t(titles[i])); } else { // we are not there, make a link if (span) buf.append(""); - buf.append("").append(_(titles[i])).append(""); + buf.append("").append(_t(titles[i])).append(""); } if (span) buf.append(" \n"); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SearchHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SearchHelper.java index 3ee03289be..e04809d6f3 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SearchHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SearchHelper.java @@ -71,7 +71,7 @@ public class SearchHelper extends HelperBase { } } StringBuilder buf = new StringBuilder(1024); - buf.append(""); for (String name : _engines.keySet()) { buf.append("\n"); + buf.append(_t(group)).append("\n"); // let's just do the groups //Set stats = (Set)entry.getValue(); //for (Iterator statIter = stats.iterator(); statIter.hasNext(); ) { @@ -54,14 +54,14 @@ public class StatsGenerator { //out.write(buf.toString()); //buf.setLength(0); } - buf.append(" "); + buf.append(" "); buf.append(""); - buf.append(_("Statistics gathered during this router's uptime")).append(" ("); + buf.append(_t("Statistics gathered during this router's uptime")).append(" ("); long uptime = _context.router().getUptime(); buf.append(DataHelper.formatDuration2(uptime)); - buf.append("). ").append( _("The data gathered is quantized over a 1 minute period, so should just be used as an estimate.")); - buf.append(' ').append( _("These statistics are primarily used for development and debugging.")); + buf.append("). ").append( _t("The data gathered is quantized over a 1 minute period, so should just be used as an estimate.")); + buf.append(' ').append( _t("These statistics are primarily used for development and debugging.")); out.write(buf.toString()); buf.setLength(0); @@ -72,7 +72,7 @@ public class StatsGenerator { buf.append("

                "); - buf.append(_(group)); + buf.append(_t(group)); buf.append("

                "); buf.append("
                  "); out.write(buf.toString()); @@ -102,7 +102,7 @@ public class StatsGenerator { buf.append(freq.getDescription()); buf.append("
                  "); if (freq.getEventCount() <= 0) { - buf.append(_("No lifetime events")).append("
                  \n"); + buf.append(_t("No lifetime events")).append("
                  \n"); return; } long uptime = _context.router().getUptime(); @@ -113,15 +113,15 @@ public class StatsGenerator { if (periods[i] > uptime) break; buf.append("
                • "); - renderPeriod(buf, periods[i], _("frequency")); + renderPeriod(buf, periods[i], _t("frequency")); Frequency curFreq = freq.getFrequency(periods[i]); buf.append(DataHelper.formatDuration2(Math.round(curFreq.getAverageInterval()))); buf.append("; "); - buf.append(_("Rolling average events per period")); + buf.append(_t("Rolling average events per period")); buf.append(": "); buf.append(num(curFreq.getAverageEventsPerPeriod())); buf.append("; "); - buf.append(_("Highest events per period")); + buf.append(_t("Highest events per period")); buf.append(": "); buf.append(num(curFreq.getMaxAverageEventsPerPeriod())); buf.append("; "); @@ -132,12 +132,12 @@ public class StatsGenerator { //} //buf.append(" avg interval between updates: (").append(num(curFreq.getAverageInterval())).append("ms, min "); //buf.append(num(curFreq.getMinAverageInterval())).append("ms)"); - buf.append(_("Lifetime average events per period")).append(": "); + buf.append(_t("Lifetime average events per period")).append(": "); buf.append(num(curFreq.getStrictAverageEventsPerPeriod())); buf.append("
                • \n"); } // Display the strict average - buf.append("
                • ").append(_("Lifetime average frequency")).append(": "); + buf.append("
                • ").append(_t("Lifetime average frequency")).append(": "); buf.append(DataHelper.formatDuration2(freq.getFrequency())); buf.append(" ("); buf.append(ngettext("1 event", "{0} events", (int) freq.getEventCount())); @@ -153,7 +153,7 @@ public class StatsGenerator { buf.append("
                  "); } if (rate.getLifetimeEventCount() <= 0) { - buf.append(_("No lifetime events")).append("
                  \n"); + buf.append(_t("No lifetime events")).append("
                  \n"); return; } long now = _context.clock().now(); @@ -165,12 +165,12 @@ public class StatsGenerator { if (curRate.getLastCoalesceDate() <= curRate.getCreationDate()) break; buf.append("
                • "); - renderPeriod(buf, periods[i], _("rate")); + renderPeriod(buf, periods[i], _t("rate")); if (curRate.getLastEventCount() > 0) { - buf.append(_("Average")).append(": "); + buf.append(_t("Average")).append(": "); buf.append(num(curRate.getAverageValue())); buf.append("; "); - buf.append(_("Highest average")); + buf.append(_t("Highest average")); buf.append(": "); buf.append(num(curRate.getExtremeAverageValue())); buf.append("; "); @@ -199,16 +199,16 @@ public class StatsGenerator { buf.append(ngettext("There was 1 event in this period.", "There were {0} events in this period.", (int)curRate.getLastEventCount())); buf.append(' '); - buf.append(_("The period ended {0} ago.", DataHelper.formatDuration2(now - curRate.getLastCoalesceDate()))); + buf.append(_t("The period ended {0} ago.", DataHelper.formatDuration2(now - curRate.getLastCoalesceDate()))); } else { - buf.append(" ").append(_("No events")).append(" "); + buf.append(" ").append(_t("No events")).append(" "); } long numPeriods = curRate.getLifetimePeriods(); if (numPeriods > 0) { double avgFrequency = curRate.getLifetimeEventCount() / (double)numPeriods; - buf.append(" (").append(_("Average event count")).append(": "); + buf.append(" (").append(_t("Average event count")).append(": "); buf.append(num(avgFrequency)); - buf.append("; ").append(_("Events in peak period")).append(": "); + buf.append("; ").append(_t("Events in peak period")).append(": "); // This isn't really the highest event count, but the event count during the period with the highest total value. buf.append(curRate.getExtremeEventCount()); buf.append(")"); @@ -216,19 +216,19 @@ public class StatsGenerator { if (curRate.getSummaryListener() != null) { buf.append(" ").append(_("Graph Data")).append(" - "); + buf.append("\">").append(_t("Graph Data")).append(" - "); buf.append(" ").append(_("Graph Event Count")).append(""); + buf.append("&showEvents=true\">").append(_t("Graph Event Count")).append(""); // This can really blow up your browser if you click on it //buf.append(" - ").append(_("Export Data as XML")).append(""); + //buf.append("&format=xml\">").append(_t("Export Data as XML")).append(""); } buf.append("
                • \n"); } // Display the strict average - buf.append("
                • ").append(_("Lifetime average value")).append(": "); + buf.append("
                • ").append(_t("Lifetime average value")).append(": "); buf.append(num(rate.getLifetimeAverageValue())); buf.append(" ("); buf.append(ngettext("1 event", "{0} events", (int) rate.getLifetimeEventCount())); @@ -258,19 +258,19 @@ public class StatsGenerator { */ private class AlphaComparator implements Comparator { public int compare(String lhs, String rhs) { - String lname = _(lhs); - String rname = _(rhs); + String lname = _t(lhs); + String rname = _t(rhs); return Collator.getInstance().compare(lname, rname); } } /** translate a string */ - private String _(String s) { + private String _t(String s) { return Messages.getString(s, _context); } /** translate a string */ - private String _(String s, Object o) { + private String _t(String s, Object o) { return Messages.getString(s, o, _context); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java index 9f79dbfc78..29223c7bf6 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryBarRenderer.java @@ -124,9 +124,9 @@ public class SummaryBarRenderer { public String renderHelpAndFAQHTML() { StringBuilder buf = new StringBuilder(512); buf.append("

                  ") - .append(_("Help & FAQ")) + .append(_t("Help & FAQ")) .append("

                  "); return buf.toString(); } @@ -134,23 +134,23 @@ public class SummaryBarRenderer { public String renderI2PServicesHTML() { StringBuilder buf = new StringBuilder(512); buf.append("

                  ") - .append(_("I2P Services")) + .append(_t("I2P Services")) .append("

                  \n" + "
              ").append(_("Peer")).append("").append(_("Caps")).append("").append(_("Integ. Value")).append("").append(_("Last Heard About")).append("").append(_("Last Heard From")).append("").append(_("Last Good Send")).append("").append(_("Last Bad Send")).append("").append(_("10m Resp. Time")).append("").append(_("1h Resp. Time")).append("").append(_("1d Resp. Time")).append("").append(_("Last Good Lookup")).append("").append(_("Last Bad Lookup")).append("").append(_("Last Good Store")).append("").append(_("Last Bad Store")).append("").append(_("1h Fail Rate")).append("").append(_("1d Fail Rate")).append("").append(_t("Peer")).append("").append(_t("Caps")).append("").append(_t("Integ. Value")).append("").append(_t("Last Heard About")).append("").append(_t("Last Heard From")).append("").append(_t("Last Good Send")).append("").append(_t("Last Bad Send")).append("").append(_t("10m Resp. Time")).append("").append(_t("1h Resp. Time")).append("").append(_t("1d Resp. Time")).append("").append(_t("Last Good Lookup")).append("").append(_t("Last Bad Lookup")).append("").append(_t("Last Good Store")).append("").append(_t("Last Bad Store")).append("").append(_t("1h Fail Rate")).append("").append(_t("1d Fail Rate")).append("
              ").append(davg(dbh, 24*60*60*1000l, ra)).append("").append(_(NA)); + buf.append("").append(_t(NA)); } buf.append("
              " + "") - .append(nbsp(_("Email"))) + .append(nbsp(_t("Email"))) .append("\n" + "") - .append(nbsp(_("Torrents"))) + .append(nbsp(_t("Torrents"))) .append("\n" + "") - .append(nbsp(_("Website"))) + .append(nbsp(_t("Website"))) .append("\n") .append(NavHelper.getClientAppLinks(_context)) @@ -172,73 +172,73 @@ public class SummaryBarRenderer { public String renderI2PInternalsHTML() { StringBuilder buf = new StringBuilder(512); buf.append("

              ") - .append(_("I2P Internals")) + .append(_t("I2P Internals")) .append("


              \n" + "
              \n" + "") - .append(nbsp(_("Tunnels"))) + .append(nbsp(_t("Tunnels"))) .append("\n" + "") - .append(nbsp(_("Peers"))) + .append(nbsp(_t("Peers"))) .append("\n" + "") - .append(nbsp(_("Profiles"))) + .append(nbsp(_t("Profiles"))) .append("\n" + "") - .append(nbsp(_("NetDB"))) + .append(nbsp(_t("NetDB"))) .append("\n" + "") - .append(nbsp(_("Logs"))) + .append(nbsp(_t("Logs"))) .append("\n"); // "") - // .append(_("Jobs")) + // .append(_t("Jobs")) // .append("\n" + if (!StatSummarizer.isDisabled()) { buf.append("") - .append(nbsp(_("Graphs"))) + .append(nbsp(_t("Graphs"))) .append("\n"); } buf.append("") - .append(nbsp(_("Stats"))) + .append(nbsp(_t("Stats"))) .append("\n" + "") - .append(nbsp(_("Addressbook"))) + .append(nbsp(_t("Addressbook"))) .append("\n" + "") - .append(nbsp(_("Hidden Services Manager"))) + .append(nbsp(_t("Hidden Services Manager"))) .append("\n"); if (_context.getBooleanProperty(HelperBase.PROP_ADVANCED)) @@ -254,44 +254,44 @@ public class SummaryBarRenderer { if (_helper == null) return ""; StringBuilder buf = new StringBuilder(512); buf.append("

              ") - .append(_("General")) + .append(_t("General")) .append("


              \n" + "" + "" + "\n" + "" + "" + "\n" + "" + "" + "
              ") - .append(_("Local Identity")) + .append(_t("Local Identity")) .append(":" + "") - .append(_("show")) + .append(_t("show")) .append("
              ") - .append(_("Version")) + .append(_t("Version")) .append(":") .append(_helper.getVersion()) .append("
              ") - .append(_("Uptime")) + .append(_t("Uptime")) .append(":") .append(_helper.getUptime()) @@ -304,20 +304,20 @@ public class SummaryBarRenderer { StringBuilder buf = new StringBuilder(512); buf.append("" + "" + "" + "\n" + "" + "" + ""); if (sessionObject.folder.getPages() > 1 && i > 30) { @@ -2270,27 +2270,27 @@ public class WebMail extends HttpServlet out.println("\n"); } out.println( "
              ") - .append(_("Version")) + .append(_t("Version")) .append(":") .append(_helper.getVersion()) .append("
              ") - .append(_("Uptime")) + .append(_t("Uptime")) .append(":") .append(_helper.getUptime()) @@ -329,9 +329,9 @@ public class SummaryBarRenderer { if (_helper == null) return ""; StringBuilder buf = new StringBuilder(512); buf.append("

              ") - .append(_("Network")) + .append(_t("Network")) .append(": ") .append(_helper.getReachability()) .append("

              \n"); @@ -340,9 +340,9 @@ public class SummaryBarRenderer { if ("ru".equals(Messages.getLanguage(_context))) buf.append("-ru"); buf.append("\" target=\"_top\" title=\"") - .append(_("See more information on the wiki")) + .append(_t("See more information on the wiki")) .append("\">") - .append(_("Warning: ECDSA is not available. Update your Java or OS")) + .append(_t("Warning: ECDSA is not available. Update your Java or OS")) .append("\n"); } return buf.toString(); @@ -354,9 +354,9 @@ public class SummaryBarRenderer { if ("".equals(updateStatus)) return ""; StringBuilder buf = new StringBuilder(512); buf.append("

              ") - .append(_("I2P Update")) + .append(_t("I2P Update")) .append("


              \n"); buf.append(updateStatus); return buf.toString(); @@ -373,18 +373,18 @@ public class SummaryBarRenderer { if (_helper == null) return ""; StringBuilder buf = new StringBuilder(512); buf.append("

              ") - .append(_("Peers")) + .append(_t("Peers")) .append("


              \n" + "\n" + "" + "\n" + "" + "\n" + "" + "\n" + "" + "\n" + "" + "\n" + @@ -443,9 +443,9 @@ public class SummaryBarRenderer { if (_helper == null) return ""; StringBuilder buf = new StringBuilder(512); buf.append("

              ") - .append(_("Bandwidth in/out")) + .append(_t("Bandwidth in/out")) .append("


              " + "
              ") - .append(_("Active")) + .append(_t("Active")) .append(":"); int active = _helper.getActivePeers(); buf.append(active) @@ -393,37 +393,37 @@ public class SummaryBarRenderer { .append("
              ") - .append(_("Fast")) + .append(_t("Fast")) .append(":") .append(_helper.getFastPeers()) .append("
              ") - .append(_("High capacity")) + .append(_t("High capacity")) .append(":") .append(_helper.getHighCapacityPeers()) .append("
              ") - .append(_("Integrated")) + .append(_t("Integrated")) .append(":") .append(_helper.getWellIntegratedPeers()) .append("
              ") - .append(_("Known")) + .append(_t("Known")) .append(":") .append(_helper.getAllPeers()) .append("
              \n" + @@ -465,14 +465,14 @@ public class SummaryBarRenderer { if (_context.router().getUptime() > 2*60*1000) { buf.append("\n"); } buf.append("\n
              ") - .append(_("Total")) + .append(_t("Total")) .append(":") .append(_helper.getLifetimeKBps()) .append("Bps
              ") - .append(_("Used")) + .append(_t("Used")) .append(":") .append(_helper.getInboundTransferred()) .append(SummaryHelper.THINSP) @@ -487,44 +487,44 @@ public class SummaryBarRenderer { if (_helper == null) return ""; StringBuilder buf = new StringBuilder(512); buf.append("

              ") - .append(_("Tunnels")) + .append(_t("Tunnels")) .append("


              " + "\n" + "" + "\n" + "" + "\n" + "" + "\n" + "" + "\n" + @@ -537,46 +537,46 @@ public class SummaryBarRenderer { if (_helper == null) return ""; StringBuilder buf = new StringBuilder(512); buf.append("

              ") - .append(_("Congestion")) + .append(_t("Congestion")) .append("


              " + "
              ") - .append(_("Exploratory")) + .append(_t("Exploratory")) .append(":") .append(_helper.getInboundTunnels() + _helper.getOutboundTunnels()) .append("
              ") - .append(_("Client")) + .append(_t("Client")) .append(":") .append(_helper.getInboundClientTunnels() + _helper.getOutboundClientTunnels()) .append("
              ") - .append(_("Participating")) + .append(_t("Participating")) .append(":") .append(_helper.getParticipatingTunnels()) .append("
              ") - .append(_("Share ratio")) + .append(_t("Share ratio")) .append(":") .append(_helper.getShareRatio()) .append("
              \n" + "" + "\n" + "" + "\n"); if (!_context.getBooleanPropertyDefaultTrue("router.disableTunnelTesting")) { buf.append("" + "\n"); } buf.append("" + "\n" + @@ -589,7 +589,7 @@ public class SummaryBarRenderer { if (_helper == null) return ""; StringBuilder buf = new StringBuilder(50); buf.append("

              ") - .append(_(_helper.getTunnelStatus())) + .append(_t(_helper.getTunnelStatus())) .append("

              \n"); return buf.toString(); } @@ -612,7 +612,7 @@ public class SummaryBarRenderer { // Set up title and pre-headings stuff. //buf.append("

              ") buf.append("

              ") - .append(_("News & Updates")) + .append(_t("News & Updates")) .append("


              \n"); // Get news content. List entries = Collections.emptyList(); @@ -647,11 +647,11 @@ public class SummaryBarRenderer { } buf.append("\n"); //buf.append("") - // .append(_("Show all news")) + // .append(_t("Show all news")) // .append("\n"); } else { buf.append("
              ") - .append(_("none")) + .append(_t("none")) .append("
              "); } // Add post-headings stuff. @@ -661,7 +661,7 @@ public class SummaryBarRenderer { } /** translate a string */ - private String _(String s) { + private String _t(String s) { return Messages.getString(s, _context); } 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 1cd207e454..88a0e43d95 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -114,7 +114,7 @@ public class SummaryHelper extends HelperBase { long diff = Math.abs(ms); if (diff < 3000) return ""; - return " (" + DataHelper.formatDuration2(diff) + " " + _("skew") + ")"; + return " (" + DataHelper.formatDuration2(diff) + " " + _t("skew") + ")"; } **/ @@ -140,19 +140,19 @@ public class SummaryHelper extends HelperBase { return "VM Comm System"; 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 _t("ERR-Client Manager I2CP Error - check logs"); // not a router problem but the user should know // Warn based on actual skew from peers, not update status, so if we successfully offset // the clock, we don't complain. //if (!_context.clock().getUpdatedSuccessfully()) long skew = _context.commSystem().getFramedAveragePeerClockSkew(33); // Display the actual skew, not the offset if (Math.abs(skew) > 30*1000) - return _("ERR-Clock Skew of {0}", DataHelper.formatDuration2(Math.abs(skew))); + return _t("ERR-Clock Skew of {0}", DataHelper.formatDuration2(Math.abs(skew))); if (_context.router().isHidden()) - return _("Hidden"); + return _t("Hidden"); RouterInfo routerInfo = _context.router().getRouterInfo(); if (routerInfo == null) - return _("Testing"); + return _t("Testing"); Status status = _context.commSystem().getStatus(); switch (status) { @@ -164,37 +164,37 @@ public class SummaryHelper extends HelperBase { case IPV4_SNAT_IPV6_OK: RouterAddress ra = routerInfo.getTargetAddress("NTCP"); if (ra == null) - return _(status.toStatusString()); + return _t(status.toStatusString()); byte[] ip = ra.getIP(); if (ip == null) - return _("ERR-Unresolved TCP Address"); + return _t("ERR-Unresolved TCP Address"); // TODO set IPv6 arg based on configuration? if (TransportUtil.isPubliclyRoutable(ip, true)) - return _(status.toStatusString()); - return _("ERR-Private TCP Address"); + return _t(status.toStatusString()); + return _t("ERR-Private TCP Address"); case IPV4_SNAT_IPV6_UNKNOWN: case DIFFERENT: - return _("ERR-SymmetricNAT"); + return _t("ERR-SymmetricNAT"); case REJECT_UNSOLICITED: case IPV4_DISABLED_IPV6_FIREWALLED: if (routerInfo.getTargetAddress("NTCP") != null) - return _("WARN-Firewalled with Inbound TCP Enabled"); + return _t("WARN-Firewalled with Inbound TCP Enabled"); // fall through... case IPV4_FIREWALLED_IPV6_OK: case IPV4_FIREWALLED_IPV6_UNKNOWN: if (((FloodfillNetworkDatabaseFacade)_context.netDb()).floodfillEnabled()) - return _("WARN-Firewalled and Floodfill"); + return _t("WARN-Firewalled and Floodfill"); //if (_context.router().getRouterInfo().getCapabilities().indexOf('O') >= 0) - // return _("WARN-Firewalled and Fast"); - return _(status.toStatusString()); + // return _t("WARN-Firewalled and Fast"); + return _t(status.toStatusString()); case DISCONNECTED: - return _("Disconnected - check network cable"); + return _t("Disconnected - check network cable"); case HOSED: - return _("ERR-UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart"); + return _t("ERR-UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart"); case UNKNOWN: case IPV4_UNKNOWN_IPV6_FIREWALLED: @@ -203,14 +203,14 @@ public class SummaryHelper extends HelperBase { ra = routerInfo.getTargetAddress("SSU"); if (ra == null && _context.router().getUptime() > 5*60*1000) { if (getActivePeers() <= 0) - return _("ERR-No Active Peers, Check Network Connection and Firewall"); + return _t("ERR-No Active Peers, Check Network Connection and Firewall"); else 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 _t("ERR-UDP Disabled and Inbound TCP host/port not set"); else - return _("WARN-Firewalled with UDP Disabled"); + return _t("WARN-Firewalled with UDP Disabled"); } - return _(status.toStatusString()); + return _t(status.toStatusString()); } } @@ -434,8 +434,8 @@ public class SummaryHelper extends HelperBase { StringBuilder buf = new StringBuilder(512); buf.append("

              ").append(_("Local Tunnels")) + .append(_t("Add/remove/edit & control your client and server tunnels")) + .append("\">").append(_t("Local Tunnels")) .append("


              "); if (!clients.isEmpty()) { Collections.sort(clients, new AlphaComparator()); @@ -447,11 +447,11 @@ public class SummaryHelper extends HelperBase { buf.append("

              \n"); + buf.append("\n"); } else { // green light - buf.append("\n"); + buf.append("\n"); } } else { // yellow light - buf.append("\n"); + buf.append("\n"); } } buf.append("
              ") - .append(_("Job lag")) + .append(_t("Job lag")) .append(":") .append(_helper.getJobLag()) .append("
              ") - .append(_("Message delay")) + .append(_t("Message delay")) .append(":") .append(_helper.getMessageDelay()) .append("
              ") - .append(_("Tunnel lag")) + .append(_t("Tunnel lag")) .append(":") .append(_helper.getTunnelLag()) .append("
              ") - .append(_("Backlog")) + .append(_t("Backlog")) .append(":") .append(_helper.getInboundBacklog()) .append("
              \"Server\""); + buf.append("server.png\" alt=\"Server\" title=\"").append(_t("Hidden Service")).append("\">"); else - buf.append("client.png\" alt=\"Client\" title=\"").append(_("Client")).append("\">"); + buf.append("client.png\" alt=\"Client\" title=\"").append(_t("Client")).append("\">"); buf.append(""); + buf.append("\" target=\"_top\" title=\"").append(_t("Show tunnels")).append("\">"); if (name.length() <= 20) buf.append(DataHelper.escapeHTML(name)); else @@ -462,20 +462,20 @@ public class SummaryHelper extends HelperBase { long timeToExpire = ls.getEarliestLeaseDate() - _context.clock().now(); if (timeToExpire < 0) { // red or yellow light - buf.append("\"").append(_("Rebuilding")).append("…\"
              \"").append(_t("Rebuilding")).append("…\"
              \"Ready\"
              \"Ready\"
              \"").append(_("Building")).append("…\"
              \"").append(_t("Building")).append("…\"
              "); } else { - buf.append("
              ").append(_("none")).append("
              "); + buf.append("
              ").append(_t("none")).append("
              "); } buf.append("\n"); return buf.toString(); @@ -486,7 +486,7 @@ public class SummaryHelper extends HelperBase { * Inner class, can't be Serializable */ private class AlphaComparator implements Comparator { - private final String xsc = _("shared clients"); + private final String xsc = _t("shared clients"); public int compare(Destination lhs, Destination rhs) { String lname = getName(lhs); @@ -511,9 +511,9 @@ public class SummaryHelper extends HelperBase { if (name == null) name = d.calculateHash().toBase64().substring(0,6); else - name = _(name); + name = _t(name); } else { - name = _(name); + name = _t(name); } return name; } @@ -712,12 +712,12 @@ public class SummaryHelper extends HelperBase { buf.append("
              "); else needSpace = true; - buf.append("

              ").append(_("Update downloaded")).append("
              "); + buf.append("

              ").append(_t("Update downloaded")).append("
              "); if (_context.hasWrapper()) - buf.append(_("Click Restart to install")); + buf.append(_t("Click Restart to install")); else - buf.append(_("Click Shutdown and restart to install")); - buf.append(' ').append(_("Version {0}", DataHelper.escapeHTML(dver))); + buf.append(_t("Click Shutdown and restart to install")); + buf.append(' ').append(_t("Version {0}", DataHelper.escapeHTML(dver))); buf.append("

              "); } boolean avail = updateAvailable(); @@ -731,8 +731,8 @@ public class SummaryHelper extends HelperBase { buf.append("
              "); else needSpace = true; - buf.append("

              ").append(_("Update available")).append(":
              "); - buf.append(_("Version {0}", getUpdateVersion())).append("
              "); + buf.append("

              ").append(_t("Update available")).append(":
              "); + buf.append(_t("Version {0}", getUpdateVersion())).append("
              "); buf.append(constraint).append("

              "); avail = false; } @@ -755,7 +755,7 @@ public class SummaryHelper extends HelperBase { if (avail) { buf.append("
              \n"); } if (devSU3Avail) { @@ -763,7 +763,7 @@ public class SummaryHelper extends HelperBase { // Note to translators: parameter is a router version, e.g. "0.9.19-16" //
              is optional, to help the browser make the lines even in the button // If the translation is shorter than the English, you should probably not include
              - .append(_("Download Signed
              Development Update
              {0}", getDevSU3UpdateVersion())) + .append(_t("Download Signed
              Development Update
              {0}", getDevSU3UpdateVersion())) .append("
              \n"); } if (unsignedAvail) { @@ -771,7 +771,7 @@ public class SummaryHelper extends HelperBase { // Note to translators: parameter is a date and time, e.g. "02-Mar 20:34 UTC" //
              is optional, to help the browser make the lines even in the button // If the translation is shorter than the English, you should probably not include
              - .append(_("Download Unsigned
              Update {0}", getUnsignedUpdateVersion())) + .append(_t("Download Unsigned
              Update {0}", getUnsignedUpdateVersion())) .append("
              \n"); } buf.append("\n"); @@ -795,9 +795,9 @@ public class SummaryHelper extends HelperBase { StringBuilder buf = new StringBuilder(256); if (showFirewallWarning()) { buf.append("

              ") - .append(_("Check network connection and NAT/firewall")) + .append(_t("Check network connection and NAT/firewall")) .append("

              "); } @@ -816,7 +816,7 @@ public class SummaryHelper extends HelperBase { String uri = getRequestURI(); buf.append("

              \n"); buf.append("\n"); - buf.append("

              \n"); + buf.append("

              \n"); } } // If a new reseed ain't running, and the last reseed had errors, show error message @@ -901,18 +901,18 @@ public class SummaryHelper extends HelperBase { StringBuilder buf = new StringBuilder(2048); buf.append("\n"); for (String section : sections) { int i = sections.indexOf(section); buf.append("\n"); } buf.append("" + "") .append("
              ") - .append(_("Remove")) + .append(_t("Remove")) .append("") - .append(_("Name")) + .append(_t("Name")) .append("") - .append(_("Order")) + .append(_t("Order")) .append("
              ") - .append(_(sectionNames.get(section))) + .append(_t(sectionNames.get(section))) .append("\"")"); buf.append(""); } buf.append(""); @@ -945,34 +945,34 @@ public class SummaryHelper extends HelperBase { buf.append(""); buf.append(""); } buf.append("
              " + "") - .append(_("Add")).append(": " + + .append(_t("Add")).append(": " + "" + "
              \n"); return buf.toString(); diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java index 06d6e9af51..d97d185a85 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryRenderer.java @@ -139,9 +139,9 @@ class SummaryRenderer { else p = DataHelper.formatDuration2(period).replace(" ", " "); if (showEvents) - title = name + ' ' + _("events in {0}", p); + title = name + ' ' + _t("events in {0}", p); else - title = name + ' ' + _("averaged for {0}", p); + title = name + ' ' + _t("averaged for {0}", p); def.setTitle(title); } String path = _listener.getData().getPath(); @@ -151,7 +151,7 @@ class SummaryRenderer { if (showEvents) { // include the average event count on the plot plotName = dsNames[1]; - descr = _("Events per period"); + descr = _t("Events per period"); } else { // include the average value plotName = dsNames[0]; @@ -159,12 +159,12 @@ class SummaryRenderer { // (there are over 500 of them) // but the descriptions for the default graphs are tagged in // Strings.java - descr = _(_listener.getRate().getRateStat().getDescription()); + descr = _t(_listener.getRate().getRateStat().getDescription()); } //long started = ((RouterContext)_context).router().getWhenStarted(); //if (started > start && started < end) - // def.vrule(started / 1000, RESTART_BAR_COLOR, _("Restart"), 4.0f); + // def.vrule(started / 1000, RESTART_BAR_COLOR, _t("Restart"), 4.0f); def.datasource(plotName, path, plotName, SummaryListener.CF, _listener.getBackendName()); if (descr.length() > 0) { @@ -173,22 +173,22 @@ class SummaryRenderer { def.area(plotName, Color.BLUE); } if (!hideLegend) { - def.gprint(plotName, SummaryListener.CF, _("avg") + ": %.2f %s"); - def.gprint(plotName, "MAX", ' ' + _("max") + ": %.2f %S"); - def.gprint(plotName, "LAST", ' ' + _("now") + ": %.2f %S\\r"); + def.gprint(plotName, SummaryListener.CF, _t("avg") + ": %.2f %s"); + def.gprint(plotName, "MAX", ' ' + _t("max") + ": %.2f %S"); + def.gprint(plotName, "LAST", ' ' + _t("now") + ": %.2f %S\\r"); } String plotName2 = null; if (lsnr2 != null) { String dsNames2[] = lsnr2.getData().getDsNames(); plotName2 = dsNames2[0]; String path2 = lsnr2.getData().getPath(); - String descr2 = _(lsnr2.getRate().getRateStat().getDescription()); + String descr2 = _t(lsnr2.getRate().getRateStat().getDescription()); def.datasource(plotName2, path2, plotName2, SummaryListener.CF, lsnr2.getBackendName()); def.line(plotName2, Color.RED, descr2 + "\\r", 3); if (!hideLegend) { - def.gprint(plotName2, SummaryListener.CF, _("avg") + ": %.2f %s"); - def.gprint(plotName2, "MAX", ' ' + _("max") + ": %.2f %S"); - def.gprint(plotName2, "LAST", ' ' + _("now") + ": %.2f %S\\r"); + def.gprint(plotName2, SummaryListener.CF, _t("avg") + ": %.2f %s"); + def.gprint(plotName2, "MAX", ' ' + _t("max") + ": %.2f %S"); + def.gprint(plotName2, "LAST", ' ' + _t("now") + ": %.2f %S\\r"); } } if (!hideLegend) { @@ -198,7 +198,7 @@ class SummaryRenderer { for (Map.Entry event : events.entrySet()) { long started = event.getKey().longValue(); if (started > start && started < end) { - String legend = _("Restart") + ' ' + sdf.format(new Date(started)) + " UTC " + event.getValue() + "\\r"; + String legend = _t("Restart") + ' ' + sdf.format(new Date(started)) + " UTC " + event.getValue() + "\\r"; def.vrule(started / 1000, RESTART_BAR_COLOR, legend, 4.0f); } } @@ -271,7 +271,7 @@ class SummaryRenderer { private static final boolean IS_WIN = SystemVersion.isWindows(); /** translate a string */ - private String _(String s) { + private String _t(String s) { // the RRD font doesn't have zh chars, at least on my system // Works on 1.5.9 except on windows if (IS_WIN && "zh".equals(Messages.getLanguage(_context))) @@ -282,7 +282,7 @@ class SummaryRenderer { /** * translate a string with a parameter */ - private String _(String s, String o) { + private String _t(String s, String o) { // the RRD font doesn't have zh chars, at least on my system // Works on 1.5.9 except on windows if (IS_WIN && "zh".equals(Messages.getLanguage(_context))) diff --git a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java index 9fff49d1e5..3784e4a30a 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java @@ -33,7 +33,7 @@ public class TunnelRenderer { } public void renderStatusHTML(Writer out) throws IOException { - out.write("

              " + _("Exploratory tunnels") + " (" + _("configure") + ")

              \n"); + out.write("

              " + _t("Exploratory tunnels") + " (" + _t("configure") + ")

              \n"); renderPool(out, _context.tunnelManager().getInboundExploratoryPool(), _context.tunnelManager().getOutboundExploratoryPool()); List destinations = null; @@ -57,20 +57,20 @@ public class TunnelRenderer { if (name == null) name = client.toBase64().substring(0,4); out.write("

              " + _("Client tunnels for") + ' ' + DataHelper.escapeHTML(_(name))); + + "\" >" + _t("Client tunnels for") + ' ' + DataHelper.escapeHTML(_t(name))); if (isLocal) - out.write(" (" + _("configure") + ")

              \n"); + out.write(" (" + _t("configure") + ")

              \n"); else - out.write(" (" + _("dead") + ")

              \n"); + out.write(" (" + _t("dead") + ")\n"); renderPool(out, in, outPool); } List participating = _context.tunnelDispatcher().listParticipatingTunnels(); Collections.sort(participating, new TunnelComparator()); - out.write("

              " + _("Participating tunnels") + "

              \n"); - out.write("" - + "\n"); + out.write("

              " + _t("Participating tunnels") + "

              " + _("Receive on") + "" + _("From") + "" - + _("Send on") + "" + _("To") + "" + _("Expiration") + "" + _("Usage") + "" + _("Rate") + "" + _("Role") + "
              \n"); + out.write("" + + "\n"); long processed = 0; RateStat rs = _context.statManager().getRate("tunnel.participatingMessageCount"); if (rs != null) @@ -108,7 +108,7 @@ public class TunnelRenderer { if (timeLeft > 0) out.write(""); else - out.write(""); + out.write(""); out.write(""); int lifetime = (int) ((_context.clock().now() - cfg.getCreation()) / 1000); if (lifetime <= 0) @@ -118,18 +118,18 @@ public class TunnelRenderer { int bps = 1024 * cfg.getProcessedMessagesCount() / lifetime; out.write(""); if (cfg.getSendTo() == null) - out.write(""); + out.write(""); else if (cfg.getReceiveFrom() == null) - out.write(""); + out.write(""); else - out.write(""); + out.write(""); out.write("\n"); } out.write("
              " + _t("Receive on") + "" + _t("From") + "" + + _t("Send on") + "" + _t("To") + "" + _t("Expiration") + "" + _t("Usage") + "" + _t("Rate") + "" + _t("Role") + "
              " + DataHelper.formatDuration2(timeLeft) + "(" + _("grace period") + ")(" + _t("grace period") + ")" + cfg.getProcessedMessagesCount() + " KB" + bps + " Bps" + _("Outbound Endpoint") + "" + _t("Outbound Endpoint") + "" + _("Inbound Gateway") + "" + _t("Inbound Gateway") + "" + _("Participant") + "" + _t("Participant") + "
              \n"); if (displayed > DISPLAY_LIMIT) - out.write("
              " + _("Limited display to the {0} tunnels with the highest usage", DISPLAY_LIMIT) + "
              \n"); - out.write("
              " + _("Inactive participating tunnels") + ": " + inactive + "
              \n"); - out.write("
              " + _("Lifetime bandwidth usage") + ": " + DataHelper.formatSize2(processed*1024) + "B
              \n"); + out.write("
              " + _t("Limited display to the {0} tunnels with the highest usage", DISPLAY_LIMIT) + "
              \n"); + out.write("
              " + _t("Inactive participating tunnels") + ": " + inactive + "
              \n"); + out.write("
              " + _t("Lifetime bandwidth usage") + ": " + DataHelper.formatSize2(processed*1024) + "B
              \n"); //renderPeers(out); out.write(""); } @@ -159,16 +159,16 @@ public class TunnelRenderer { if (info.getLength() > maxLength) maxLength = info.getLength(); } - out.write(""); + out.write("
              " + _("In/Out") + "" + _("Expiry") + "" + _("Usage") + "" + _("Gateway") + "
              "); if (maxLength > 3) { out.write(""); + out.write("\">" + _t("Participants") + ""); } else if (maxLength == 3) { - out.write(""); + out.write(""); } if (maxLength > 1) { - out.write(""); + out.write(""); } out.write("\n"); for (int i = 0; i < tunnels.size(); i++) { @@ -208,22 +208,22 @@ public class TunnelRenderer { if (in != null) { List pending = in.listPending(); if (!pending.isEmpty()) { - out.write("
              " + _("Build in progress") + ": " + pending.size() + " " + _("inbound") + "
              \n"); + out.write("
              " + _t("Build in progress") + ": " + pending.size() + " " + _t("inbound") + "
              \n"); live += pending.size(); } } if (outPool != null) { List pending = outPool.listPending(); if (!pending.isEmpty()) { - out.write("
              " + _("Build in progress") + ": " + pending.size() + " " + _("outbound") + "
              \n"); + out.write("
              " + _t("Build in progress") + ": " + pending.size() + " " + _t("outbound") + "
              \n"); live += pending.size(); } } if (live <= 0) - out.write("
              " + _("No tunnels; waiting for the grace period to end.") + "
              \n"); - out.write("
              " + _("Lifetime bandwidth usage") + ": " + - DataHelper.formatSize2(processedIn*1024) + "B " + _("in") + ", " + - DataHelper.formatSize2(processedOut*1024) + "B " + _("out") + "
              "); + out.write("
              " + _t("No tunnels; waiting for the grace period to end.") + "
              \n"); + out.write("
              " + _t("Lifetime bandwidth usage") + ": " + + DataHelper.formatSize2(processedIn*1024) + "B " + _t("in") + ", " + + DataHelper.formatSize2(processedOut*1024) + "B " + _t("out") + "
              "); } /**** @@ -241,8 +241,8 @@ public class TunnelRenderer { List peerList = new ArrayList(peers); Collections.sort(peerList, new CountryComparator(this._context.commSystem())); - out.write("

              " + _("Tunnel Counts By Peer") + "

              \n"); - out.write("
              " + _t("In/Out") + "" + _t("Expiry") + "" + _t("Usage") + "" + _t("Gateway") + "" + _("Participants") + "" + _("Participant") + "" + _t("Participant") + "" + _("Endpoint") + "" + _t("Endpoint") + "
              \n"); + out.write("

              " + _t("Tunnel Counts By Peer") + "

              \n"); + out.write("
              " + _("Peer") + "" + _("Our Tunnels") + "" + _("% of total") + "" + _("Participating Tunnels") + "" + _("% of total") + "
              \n"); for (Hash h : peerList) { out.write("
              " + _t("Peer") + "" + _t("Our Tunnels") + "" + _t("% of total") + "" + _t("Participating Tunnels") + "" + _t("% of total") + "
              "); out.write(netDbLink(h)); @@ -260,7 +260,7 @@ public class TunnelRenderer { out.write('0'); out.write('\n'); } - out.write("
              " + _("Totals") + " " + tunnelCount); + out.write("
              " + _t("Totals") + " " + tunnelCount); out.write("   " + partCount); out.write("  
              \n"); } @@ -343,12 +343,12 @@ public class TunnelRenderer { } /** translate a string */ - private String _(String s) { + private String _t(String s) { return Messages.getString(s, _context); } /** translate a string */ - public String _(String s, Object o) { + public String _t(String s, Object o) { return Messages.getString(s, o, _context); } } diff --git a/apps/routerconsole/java/strings/Strings.java b/apps/routerconsole/java/strings/Strings.java index 4629380179..8254d657b5 100644 --- a/apps/routerconsole/java/strings/Strings.java +++ b/apps/routerconsole/java/strings/Strings.java @@ -9,76 +9,76 @@ package dummy; class Dummy { void dummy { // wars for ConfigClientsHelper - _("addressbook"); - _("i2psnark"); - _("i2ptunnel"); - _("susimail"); - _("susidns"); - _("routerconsole"); + _t("addressbook"); + _t("i2psnark"); + _t("i2ptunnel"); + _t("susimail"); + _t("susidns"); + _t("routerconsole"); // clients, taken from clients.config, for ConfigClientsHelper // note that if the wording changes in clients.config, we have to // keep the old string here as well for existing installs - _("Web console"); - _("SAM application bridge"); - _("Application tunnels"); - _("My eepsite web server"); - _("I2P webserver (eepsite)"); - _("Browser launch at startup"); - _("BOB application bridge"); - _("I2P Router Console"); - _("Open Router Console in web browser at startup"); + _t("Web console"); + _t("SAM application bridge"); + _t("Application tunnels"); + _t("My eepsite web server"); + _t("I2P webserver (eepsite)"); + _t("Browser launch at startup"); + _t("BOB application bridge"); + _t("I2P Router Console"); + _t("Open Router Console in web browser at startup"); // tunnel nicknames, taken from i2ptunnel.config so they will display // nicely under 'local destinations' in the summary bar // note that if the wording changes in i2ptunnel.config, we have to // keep the old string here as well for existing installs - _("shared clients"); - _("shared clients (DSA)"); - _("IRC proxy"); - _("eepsite"); - _("I2P webserver"); - _("HTTP Proxy"); + _t("shared clients"); + _t("shared clients (DSA)"); + _t("IRC proxy"); + _t("eepsite"); + _t("I2P webserver"); + _t("HTTP Proxy"); // older names for pre-0.7.4 installs - _("eepProxy"); - _("ircProxy"); + _t("eepProxy"); + _t("ircProxy"); // hardcoded in i2psnark - _("I2PSnark"); + _t("I2PSnark"); // hardcoded in iMule? - _("iMule"); + _t("iMule"); // standard themes for ConfigUIHelper - _("classic"); - _("dark"); - _("light"); - _("midnight"); + _t("classic"); + _t("dark"); + _t("light"); + _t("midnight"); // stat groups for stats.jsp - _("Bandwidth"); - _("BandwidthLimiter"); - _("ClientMessages"); - _("Encryption"); - _("i2cp"); - _("I2PTunnel"); - _("InNetPool"); - _("JobQueue"); - _("NetworkDatabase"); - _("ntcp"); - _("Peers"); - _("Router"); - _("Stream"); - _("Throttle"); - _("Transport"); - _("Tunnels"); - _("udp"); + _t("Bandwidth"); + _t("BandwidthLimiter"); + _t("ClientMessages"); + _t("Encryption"); + _t("i2cp"); + _t("I2PTunnel"); + _t("InNetPool"); + _t("JobQueue"); + _t("NetworkDatabase"); + _t("ntcp"); + _t("Peers"); + _t("Router"); + _t("Stream"); + _t("Throttle"); + _t("Transport"); + _t("Tunnels"); + _t("udp"); // parameters in transport addresses (netdb.jsp) // may or may not be worth translating - _("host"); - _("key"); - _("port"); + _t("host"); + _t("key"); + _t("port"); // capabilities - _("caps"); + _t("caps"); } } diff --git a/apps/routerconsole/jsp/config.jsp b/apps/routerconsole/jsp/config.jsp index 538fb8a5f2..5e9c0de92f 100644 --- a/apps/routerconsole/jsp/config.jsp +++ b/apps/routerconsole/jsp/config.jsp @@ -14,7 +14,7 @@ " /> -

              <%=intl._("I2P Bandwidth Configuration")%>

              +

              <%=intl._t("I2P Bandwidth Configuration")%>

              <%@include file="confignav.jsi" %> @@ -25,12 +25,12 @@ -

              <%=intl._("Bandwidth limiter")%>

              +

              <%=intl._t("Bandwidth limiter")%>

              - <%=intl._("I2P will work best if you configure your rates to match the speed of your internet connection.")%> + <%=intl._t("I2P will work best if you configure your rates to match the speed of your internet connection.")%>

              <% /******** *********/ %> - +
              " > - <%=intl._("KBps In")%> + <%=intl._t("KBps In")%> ()
              <%=intl._("Share")%> <%=intl._t("Share")%> ()

              <% int share = nethelper.getShareBandwidth(); if (share < 12) { out.print(""); - out.print(intl._("NOTE")); + out.print(intl._t("NOTE")); out.print(": "); - out.print(intl._("You have configured I2P to share only {0} KBps.", share)); + out.print(intl._t("You have configured I2P to share only {0} KBps.", share)); out.print("\n"); - out.print(intl._("I2P requires at least 12KBps to enable sharing. ")); - out.print(intl._("Please enable sharing (participating in tunnels) by configuring more bandwidth. ")); - out.print(intl._("It improves your anonymity by creating cover traffic, and helps the network.")); + out.print(intl._t("I2P requires at least 12KBps to enable sharing. ")); + out.print(intl._t("Please enable sharing (participating in tunnels) by configuring more bandwidth. ")); + out.print(intl._t("It improves your anonymity by creating cover traffic, and helps the network.")); } else { - out.print(intl._("You have configured I2P to share {0} KBps.", share)); + out.print(intl._t("You have configured I2P to share {0} KBps.", share)); out.print("\n"); - out.print(intl._("The higher the share bandwidth the more you improve your anonymity and help the network.")); + out.print(intl._t("The higher the share bandwidth the more you improve your anonymity and help the network.")); } %>

              -

              <%=intl._("Advanced network configuration page")%>


              +

              <%=intl._t("Advanced network configuration page")%>


              -" > -" > +" > +" >
              diff --git a/apps/routerconsole/jsp/configadvanced.jsp b/apps/routerconsole/jsp/configadvanced.jsp index 961ac83fa8..3ba2deed10 100644 --- a/apps/routerconsole/jsp/configadvanced.jsp +++ b/apps/routerconsole/jsp/configadvanced.jsp @@ -15,7 +15,7 @@ " /> -

              <%=intl._("I2P Advanced Configuration")%>

              +

              <%=intl._t("I2P Advanced Configuration")%>

              <%@include file="confignav.jsi" %> @@ -24,14 +24,14 @@ <%@include file="formhandler.jsi" %>
              -

              <%=intl._("Floodfill Configuration")%>

              -

              <%=intl._("Floodill participation helps the network, but may use more of your computer's resources.")%> +

              <%=intl._t("Floodfill Configuration")%>

              +

              <%=intl._t("Floodill participation helps the network, but may use more of your computer's resources.")%>

              <% if (advancedhelper.isFloodfill()) { -%><%=intl._("This router is currently a floodfill participant.")%><% +%><%=intl._t("This router is currently a floodfill participant.")%><% } else { -%><%=intl._("This router is not currently a floodfill participant.")%><% +%><%=intl._t("This router is not currently a floodfill participant.")%><% } %>

              @@ -39,15 +39,15 @@ > -<%=intl._("Automatic")%>
              +<%=intl._t("Automatic")%>
              > -<%=intl._("Force On")%>
              +<%=intl._t("Force On")%>
              > -<%=intl._("Disable")%>
              +<%=intl._t("Disable")%>
              -" > +" >
              -

              <%=intl._("Advanced I2P Configuration")%>

              +

              <%=intl._t("Advanced I2P Configuration")%>

              <% if (advancedhelper.isAdvanced()) { %>
              @@ -56,11 +56,11 @@

              <% if (advancedhelper.isAdvanced()) { %>
              - " > - " > -
              <%=intl._("NOTE")%>: <%=intl._("Some changes may require a restart to take effect.")%> + " > + " > +
              <%=intl._t("NOTE")%>: <%=intl._t("Some changes may require a restart to take effect.")%>
              <% } else { %> -<%=intl._("To make changes, edit the file {0}.", "" + advancedhelper.getConfigFileName() + "")%> +<%=intl._t("To make changes, edit the file {0}.", "" + advancedhelper.getConfigFileName() + "")%> <% } // isAdvanced %>
              diff --git a/apps/routerconsole/jsp/configclients.jsp b/apps/routerconsole/jsp/configclients.jsp index 65f67daf50..cbb9710d4f 100644 --- a/apps/routerconsole/jsp/configclients.jsp +++ b/apps/routerconsole/jsp/configclients.jsp @@ -20,43 +20,43 @@ input.default { width: 1px; height: 1px; visibility: hidden; } " /> " /> -

              <%=intl._("I2P Client Configuration")%>

              +

              <%=intl._t("I2P Client Configuration")%>

              <%@include file="confignav.jsi" %> <%@include file="formhandler.jsi" %>
              -

              <%=intl._("Client Configuration")%>

              - <%=intl._("The Java clients listed below are started by the router and run in the same JVM.")%>
              - <%=intl._("Be careful changing any settings here. The 'router console' and 'application tunnels' are required for most uses of I2P. Only advanced users should change these.")%> +

              <%=intl._t("Client Configuration")%>

              + <%=intl._t("The Java clients listed below are started by the router and run in the same JVM.")%>
              + <%=intl._t("Be careful changing any settings here. The 'router console' and 'application tunnels' are required for most uses of I2P. Only advanced users should change these.")%>

              -

              <%=intl._("To change other client options, edit the file")%> +

              <%=intl._t("To change other client options, edit the file")%> <%=net.i2p.router.startup.ClientAppConfig.configFile(net.i2p.I2PAppContext.getGlobalContext()).getAbsolutePath()%>. - <%=intl._("All changes require restart to take effect.")%> + <%=intl._t("All changes require restart to take effect.")%>


              - " /> + " /> <% if (clientshelper.isClientChangeEnabled() && request.getParameter("edit") == null) { %> - " /> + " /> <% } %> - " /> + " />
              -

              <%=intl._("Advanced Client Interface Configuration")%>

              +

              <%=intl._t("Advanced Client Interface Configuration")%>

              -<%=intl._("External I2CP (I2P Client Protocol) Interface Configuration")%>
              +<%=intl._t("External I2CP (I2P Client Protocol) Interface Configuration")%>
              > -<%=intl._("Enabled without SSL")%>
              +<%=intl._t("Enabled without SSL")%>
              > -<%=intl._("Enabled with SSL required")%>
              +<%=intl._t("Enabled with SSL required")%>
              > -<%=intl._("Disabled - Clients outside this Java process may not connect")%>
              -<%=intl._("I2CP Interface")%>: +<%=intl._t("Disabled - Clients outside this Java process may not connect")%>
              +<%=intl._t("I2CP Interface")%>:
              -<%=intl._("I2CP Port")%>: +<%=intl._t("I2CP Port")%>: " >
              -<%=intl._("Authorization")%>
              +<%=intl._t("Authorization")%>
              > -<%=intl._("Require username and password")%>
              -<%=intl._("Username")%>: +<%=intl._t("Require username and password")%>
              +<%=intl._t("Username")%>:
              -<%=intl._("Password")%>: +<%=intl._t("Password")%>:
              -

              <%=intl._("The default settings will work for most people.")%> -<%=intl._("Any changes made here must also be configured in the external client.")%> -<%=intl._("Many clients do not support SSL or authorization.")%> -<%=intl._("All changes require restart to take effect.")%> +

              <%=intl._t("The default settings will work for most people.")%> +<%=intl._t("Any changes made here must also be configured in the external client.")%> +<%=intl._t("Many clients do not support SSL or authorization.")%> +<%=intl._t("All changes require restart to take effect.")%>


              -" /> -" /> -" /> +" /> +" /> +" />
              -

              <%=intl._("WebApp Configuration")%>

              - <%=intl._("The Java web applications listed below are started by the webConsole client and run in the same JVM as the router. They are usually web applications accessible through the router console. They may be complete applications (e.g. i2psnark),front-ends to another client or application which must be separately enabled (e.g. susidns, i2ptunnel), or have no web interface at all (e.g. addressbook).")%> +

              <%=intl._t("WebApp Configuration")%>

              + <%=intl._t("The Java web applications listed below are started by the webConsole client and run in the same JVM as the router. They are usually web applications accessible through the router console. They may be complete applications (e.g. i2psnark),front-ends to another client or application which must be separately enabled (e.g. susidns, i2ptunnel), or have no web interface at all (e.g. addressbook).")%>

              - <%=intl._("A web app may also be disabled by removing the .war file from the webapps directory; however the .war file and web app will reappear when you update your router to a newer version, so disabling the web app here is the preferred method.")%> + <%=intl._t("A web app may also be disabled by removing the .war file from the webapps directory; however the .war file and web app will reappear when you update your router to a newer version, so disabling the web app here is the preferred method.")%>

              -

              <%=intl._("All changes require restart to take effect.")%> +

              <%=intl._t("All changes require restart to take effect.")%>


              - " /> - " /> + " /> + " />
              <% if (clientshelper.showPlugins()) { if (clientshelper.isPluginUpdateEnabled()) { %> -

              <%=intl._("Plugin Configuration")%>

              - <%=intl._("The plugins listed below are started by the webConsole client.")%> +

              <%=intl._t("Plugin Configuration")%>

              + <%=intl._t("The plugins listed below are started by the webConsole client.")%>

              - " /> - " /> + " /> + " />
              <% } // pluginUpdateEnabled if (clientshelper.isPluginInstallEnabled()) { %> -

              <%=intl._("Plugin Installation from URL")%>

              - <%=intl._("Look for available plugins on {0}.", "plugins.i2p")%> - <%=intl._("To install a plugin, enter the download URL:")%> +

              <%=intl._t("Plugin Installation from URL")%>

              + <%=intl._t("Look for available plugins on {0}.", "plugins.i2p")%> + <%=intl._t("To install a plugin, enter the download URL:")%>

              @@ -133,31 +133,31 @@ input.default { width: 1px; height: 1px; visibility: hidden; }


              - " /> - " /> - " /> + " /> + " /> + " />
              -

              <%=intl._("Plugin Installation from File")%>

              +

              <%=intl._t("Plugin Installation from File")%>

              -

              <%=intl._("Install plugin from file.")%> -
              <%=intl._("Select xpi2p or su3 file")%> : +

              <%=intl._t("Install plugin from file.")%> +
              <%=intl._t("Select xpi2p or su3 file")%> :


              -" /> +" />
              <% } // pluginInstallEnabled if (clientshelper.isPluginUpdateEnabled()) { %> -

              <%=intl._("Update All Plugins")%>

              +

              <%=intl._t("Update All Plugins")%>

              - " /> + " />
              <% } // pluginUpdateEnabled diff --git a/apps/routerconsole/jsp/confighome.jsp b/apps/routerconsole/jsp/confighome.jsp index bf1f59d456..56be7b8bd0 100644 --- a/apps/routerconsole/jsp/confighome.jsp +++ b/apps/routerconsole/jsp/confighome.jsp @@ -17,7 +17,7 @@ input.default { <%@include file="summary.jsi" %> -

              <%=intl._("I2P Home Page Configuration")%>

              +

              <%=intl._t("I2P Home Page Configuration")%>

              <%@include file="confignav.jsi" %> @@ -26,60 +26,60 @@ input.default { " /> -

              <%=intl._("Default Home Page")%>

              +

              <%=intl._t("Default Home Page")%>

              > - <%=intl._("Use old home page")%> - " > + <%=intl._t("Use old home page")%> + " >
              <% if (homehelper.shouldShowSearch()) { %> -

              <%=intl._("Search Engines")%>

              +

              <%=intl._t("Search Engines")%>

              - " > - " > - " > - " > - " > + " > + " > + " > + " > + " >
              <% } // shouldShowSearch() %> -

              <%=intl._("Hidden Services of Interest")%>

              +

              <%=intl._t("Hidden Services of Interest")%>

              - " > - " > - " > - " > - " > + " > + " > + " > + " > + " >
              -

              <%=intl._("Applications and Configuration")%>

              +

              <%=intl._t("Applications and Configuration")%>

              - " > - " > - " > - " > - " > + " > + " > + " > + " > + " >
              diff --git a/apps/routerconsole/jsp/configkeyring.jsp b/apps/routerconsole/jsp/configkeyring.jsp index b2f5ef657c..3653a94790 100644 --- a/apps/routerconsole/jsp/configkeyring.jsp +++ b/apps/routerconsole/jsp/configkeyring.jsp @@ -10,7 +10,7 @@ <%@include file="summary.jsi" %> -

              <%=intl._("I2P Keyring Configuration")%>

              +

              <%=intl._t("I2P Keyring Configuration")%>

              <%@include file="confignav.jsi" %> @@ -18,29 +18,29 @@ <%@include file="formhandler.jsi" %> " /> -

              <%=intl._("Keyring")%>

              - <%=intl._("The router keyring is used to decrypt encrypted leaseSets.")%> - <%=intl._("The keyring may contain keys for local or remote encrypted destinations.")%>

              +

              <%=intl._t("Keyring")%>

              + <%=intl._t("The router keyring is used to decrypt encrypted leaseSets.")%> + <%=intl._t("The keyring may contain keys for local or remote encrypted destinations.")%>

              -

              <%=intl._("Manual Keyring Addition")%>

              - <%=intl._("Enter keys for encrypted remote destinations here.")%> - <%=intl._("Keys for local destinations must be entered on the")%> <%=intl._("I2PTunnel page")%>. +

              <%=intl._t("Manual Keyring Addition")%>

              + <%=intl._t("Enter keys for encrypted remote destinations here.")%> + <%=intl._t("Keys for local destinations must be entered on the")%> <%=intl._t("I2PTunnel page")%>.

              - + - +
              <%=intl._("Dest. name, hash, or full key")%>:<%=intl._t("Dest. name, hash, or full key")%>:
              <%=intl._("Encryption Key")%>:<%=intl._t("Encryption Key")%>:
              -" > -" > -" > +" > +" > +" >
              diff --git a/apps/routerconsole/jsp/configlogging.jsp b/apps/routerconsole/jsp/configlogging.jsp index 9e3be5cc76..84f10ac806 100644 --- a/apps/routerconsole/jsp/configlogging.jsp +++ b/apps/routerconsole/jsp/configlogging.jsp @@ -13,7 +13,7 @@ " /> <%@include file="summary.jsi" %> -

              <%=intl._("I2P Logging Configuration")%>

              +

              <%=intl._t("I2P Logging Configuration")%>

              <%@include file="confignav.jsi" %> @@ -23,31 +23,31 @@
              -

              <%=intl._("Configure I2P Logging Options")%>

              +

              <%=intl._t("Configure I2P Logging Options")%>

              - - - + + + - + - + - - + - + - +
              <%=intl._("Log file")%>:" value="" > -
              <%=intl._("(the symbol '@' will be replaced during log rotation)")%>
              <%=intl._("Log record format")%>:
              <%=intl._t("Log file")%>:" value="" > +
              <%=intl._t("(the symbol '@' will be replaced during log rotation)")%>
              <%=intl._t("Log record format")%>: " > -
              <%=intl._("(use 'd' = date, 'c' = class, 't' = thread, 'p' = priority, 'm' = message)")%> +
              <%=intl._t("(use 'd' = date, 'c' = class, 't' = thread, 'p' = priority, 'm' = message)")%>
              <%=intl._("Log date format")%>:
              <%=intl._t("Log date format")%>: " > -
              <%=intl._("('MM' = month, 'dd' = day, 'HH' = hour, 'mm' = minute, 'ss' = second, 'SSS' = millisecond)")%> +
              <%=intl._t("('MM' = month, 'dd' = day, 'HH' = hour, 'mm' = minute, 'ss' = second, 'SSS' = millisecond)")%>
              <%=intl._("Max log file size")%>:
              <%=intl._t("Max log file size")%>: " >
              <%=intl._("Default log level")%>:
              <%=intl._("(DEBUG and INFO are not recommended defaults, as they will drastically slow down your router)")%> +
              <%=intl._t("Default log level")%>:
              <%=intl._t("(DEBUG and INFO are not recommended defaults, as they will drastically slow down your router)")%>
              <%=intl._("Log level overrides")%>:
              <%=intl._t("Log level overrides")%>:
              <%=intl._("New override")%>:
              <%=intl._t("New override")%>:

              - " > - " > + " > + " >
              diff --git a/apps/routerconsole/jsp/confignet.jsp b/apps/routerconsole/jsp/confignet.jsp index 27fdfef7ef..7b81518e34 100644 --- a/apps/routerconsole/jsp/confignet.jsp +++ b/apps/routerconsole/jsp/confignet.jsp @@ -13,7 +13,7 @@ " /> -

              <%=intl._("I2P Network Configuration")%>

              +

              <%=intl._t("I2P Network Configuration")%>

              <%@include file="confignav.jsi" %> @@ -23,55 +23,55 @@
              -

              <%=intl._("IP and Transport Configuration")%>

              +

              <%=intl._t("IP and Transport Configuration")%>

              - <%=intl._("The default settings will work for most people.")%> - <%=intl._("There is help below.")%> -

              <%=intl._("UPnP Configuration")%>:
              + <%=intl._t("The default settings will work for most people.")%> + <%=intl._t("There is help below.")%> +

              <%=intl._t("UPnP Configuration")%>:
              > - <%=intl._("Enable UPnP to open firewall ports")%> - <%=intl._("UPnP status")%> -

              <%=intl._("IP Configuration")%>:
              - <%=intl._("Externally reachable hostname or IP address")%>:
              + <%=intl._t("Enable UPnP to open firewall ports")%> - <%=intl._t("UPnP status")%> +

              <%=intl._t("IP Configuration")%>:
              + <%=intl._t("Externally reachable hostname or IP address")%>:
              > - <%=intl._("Use all auto-detect methods")%>
              + <%=intl._t("Use all auto-detect methods")%>
              > - <%=intl._("Disable UPnP IP address detection")%>
              + <%=intl._t("Disable UPnP IP address detection")%>
              > - <%=intl._("Ignore local interface IP address")%>
              + <%=intl._t("Ignore local interface IP address")%>
              > - <%=intl._("Use SSU IP address detection only")%>
              + <%=intl._t("Use SSU IP address detection only")%>
              > - <%=intl._("Hidden mode - do not publish IP")%> <%=intl._("(prevents participating traffic)")%>
              + <%=intl._t("Hidden mode - do not publish IP")%> <%=intl._t("(prevents participating traffic)")%>
              > - <%=intl._("Specify hostname or IP")%>:
              + <%=intl._t("Specify hostname or IP")%>:
              <%=nethelper.getAddressSelector() %>

              - <%=intl._("Action when IP changes")%>:
              + <%=intl._t("Action when IP changes")%>:
              > - <%=intl._("Laptop mode - Change router identity and UDP port when IP changes for enhanced anonymity")%> - (<%=intl._("Experimental")%>) + <%=intl._t("Laptop mode - Change router identity and UDP port when IP changes for enhanced anonymity")%> + (<%=intl._t("Experimental")%>)

              - <%=intl._("IPv4 Configuration")%>:
              + <%=intl._t("IPv4 Configuration")%>:
              > - <%=intl._("Disable inbound (Firewalled by Carrier-grade NAT or DS-Lite)")%> + <%=intl._t("Disable inbound (Firewalled by Carrier-grade NAT or DS-Lite)")%>

              - <%=intl._("IPv6 Configuration")%>:
              + <%=intl._t("IPv6 Configuration")%>:
              > - <%=intl._("Disable IPv6")%>
              + <%=intl._t("Disable IPv6")%>
              > - <%=intl._("Enable IPv6")%>
              + <%=intl._t("Enable IPv6")%>
              > - <%=intl._("Prefer IPv4 over IPv6")%>
              + <%=intl._t("Prefer IPv4 over IPv6")%>
              > - <%=intl._("Prefer IPv6 over IPv4")%>
              + <%=intl._t("Prefer IPv6 over IPv4")%>
              > - <%=intl._("Use IPv6 only (disable IPv4)")%> - (<%=intl._("Experimental")%>)
              -

              <%=intl._("UDP Configuration:")%>
              - <%=intl._("UDP port:")%> + <%=intl._t("Use IPv6 only (disable IPv4)")%> + (<%=intl._t("Experimental")%>)
              +

              <%=intl._t("UDP Configuration:")%>
              + <%=intl._t("UDP port:")%> " >
              > - <%=intl._("Completely disable")%> <%=intl._("(select only if behind a firewall that blocks outbound UDP)")%>
              + <%=intl._t("Completely disable")%> <%=intl._t("(select only if behind a firewall that blocks outbound UDP)")%>
              <% /******** *********/ %>

              - <%=intl._("TCP Configuration")%>:
              - <%=intl._("Externally reachable hostname or IP address")%>:
              + <%=intl._t("TCP Configuration")%>:
              + <%=intl._t("Externally reachable hostname or IP address")%>:
              > - <%=intl._("Use auto-detected IP address")%> - (<%=intl._("currently")%> ) - <%=intl._("if we are not firewalled")%>
              + <%=intl._t("Use auto-detected IP address")%> + (<%=intl._t("currently")%> ) + <%=intl._t("if we are not firewalled")%>
              > - <%=intl._("Always use auto-detected IP address (Not firewalled)")%>
              + <%=intl._t("Always use auto-detected IP address (Not firewalled)")%>
              > - <%=intl._("Specify hostname or IP")%>: + <%=intl._t("Specify hostname or IP")%>: " >
              > - <%=intl._("Disable inbound (Firewalled)")%>
              + <%=intl._t("Disable inbound (Firewalled)")%>
              > - <%=intl._("Completely disable")%> <%=intl._("(select only if behind a firewall that throttles or blocks outbound TCP)")%>
              + <%=intl._t("Completely disable")%> <%=intl._t("(select only if behind a firewall that throttles or blocks outbound TCP)")%>

              - <%=intl._("Externally reachable TCP port")%>:
              + <%=intl._t("Externally reachable TCP port")%>:
              > - <%=intl._("Use the same port configured for UDP")%> - (<%=intl._("currently")%> )
              + <%=intl._t("Use the same port configured for UDP")%> + (<%=intl._t("currently")%> )
              > - <%=intl._("Specify Port")%>: + <%=intl._t("Specify Port")%>: " >
              -

              <%=intl._("Notes")%>: <%=intl._("a) Do not reveal your port numbers to anyone! b) Changing these settings will restart your router.")%>

              +

              <%=intl._t("Notes")%>: <%=intl._t("a) Do not reveal your port numbers to anyone! b) Changing these settings will restart your router.")%>


              -" > -" > -

              <%=intl._("Configuration Help")%>:

              - <%=intl._("While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port is forwarded for both UDP and TCP.")%> +" > +" > +

              <%=intl._t("Configuration Help")%>:

              + <%=intl._t("While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port is forwarded for both UDP and TCP.")%>

              - <%=intl._("If you can, please poke a hole in your firewall to allow unsolicited UDP and TCP packets to reach you.")%> - <%=intl._("If you can't, I2P supports UPnP (Universal Plug and Play) and UDP hole punching with \"SSU introductions\" to relay traffic.")%> - <%=intl._("Most of the options above are for special situations, for example where UPnP does not work correctly, or a firewall not under your control is doing harm.")%> - <%=intl._("Certain firewalls such as symmetric NATs may not work well with I2P.")%> + <%=intl._t("If you can, please poke a hole in your firewall to allow unsolicited UDP and TCP packets to reach you.")%> + <%=intl._t("If you can't, I2P supports UPnP (Universal Plug and Play) and UDP hole punching with \"SSU introductions\" to relay traffic.")%> + <%=intl._t("Most of the options above are for special situations, for example where UPnP does not work correctly, or a firewall not under your control is doing harm.")%> + <%=intl._t("Certain firewalls such as symmetric NATs may not work well with I2P.")%>

              <% /******** *********/ %>

              - <%=intl._("UPnP is used to communicate with Internet Gateway Devices (IGDs) to detect the external IP address and forward ports.")%> - <%=intl._("UPnP support is beta, and may not work for any number of reasons")%>: + <%=intl._t("UPnP is used to communicate with Internet Gateway Devices (IGDs) to detect the external IP address and forward ports.")%> + <%=intl._t("UPnP support is beta, and may not work for any number of reasons")%>:

                -
              • <%=intl._("No UPnP-compatible device present")%> -
              • <%=intl._("UPnP disabled on the device")%> -
              • <%=intl._("Software firewall interference with UPnP")%> -
              • <%=intl._("Bugs in the device's UPnP implementation")%> -
              • <%=intl._("Multiple firewall/routers in the internet connection path")%> -
              • <%=intl._("UPnP device change, reset, or address change")%> +
              • <%=intl._t("No UPnP-compatible device present")%> +
              • <%=intl._t("UPnP disabled on the device")%> +
              • <%=intl._t("Software firewall interference with UPnP")%> +
              • <%=intl._t("Bugs in the device's UPnP implementation")%> +
              • <%=intl._t("Multiple firewall/routers in the internet connection path")%> +
              • <%=intl._t("UPnP device change, reset, or address change")%>
              -

              <%=intl._("Review the UPnP status here.")%> -<%=intl._("UPnP may be enabled or disabled above, but a change requires a router restart to take effect.")%>

              -

              <%=intl._("Hostnames entered above will be published in the network database.")%> - <%=intl._("They are not private.")%> - <%=intl._("Also, do not enter a private IP address like 127.0.0.1 or 192.168.1.1.")%> - <%=intl._("If you specify the wrong IP address or hostname, or do not properly configure your NAT or firewall, your network performance will degrade substantially.")%> - <%=intl._("When in doubt, leave the settings at the defaults.")%> +

              <%=intl._t("Review the UPnP status here.")%> +<%=intl._t("UPnP may be enabled or disabled above, but a change requires a router restart to take effect.")%>

              +

              <%=intl._t("Hostnames entered above will be published in the network database.")%> + <%=intl._t("They are not private.")%> + <%=intl._t("Also, do not enter a private IP address like 127.0.0.1 or 192.168.1.1.")%> + <%=intl._t("If you specify the wrong IP address or hostname, or do not properly configure your NAT or firewall, your network performance will degrade substantially.")%> + <%=intl._t("When in doubt, leave the settings at the defaults.")%>

              -

              <%=intl._("Reachability Help")%>:

              - <%=intl._("While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port is forwarded for both UDP and TCP.")%> - <%=intl._("If you think you have opened up your firewall and I2P still thinks you are firewalled, remember that you may have multiple firewalls, for example both software packages and external hardware routers.")%> - <%=intl._("If there is an error, the logs may also help diagnose the problem.")%> +

              <%=intl._t("Reachability Help")%>:

              + <%=intl._t("While I2P will work fine behind most firewalls, your speeds and network integration will generally improve if the I2P port is forwarded for both UDP and TCP.")%> + <%=intl._t("If you think you have opened up your firewall and I2P still thinks you are firewalled, remember that you may have multiple firewalls, for example both software packages and external hardware routers.")%> + <%=intl._t("If there is an error, the logs may also help diagnose the problem.")%>

                -
              • <%=intl._("OK")%> - - <%=intl._("Your UDP port does not appear to be firewalled.")%> -
              • <%=intl._("Firewalled")%> - - <%=intl._("Your UDP port appears to be firewalled.")%> - <%=intl._("As the firewall detection methods are not 100% reliable, this may occasionally be displayed in error.")%> - <%=intl._("However, if it appears consistently, you should check whether both your external and internal firewalls are open for your port.")%> - <%=intl._("I2P will work fine when firewalled, there is no reason for concern. When firewalled, the router uses \"introducers\" to relay inbound connections.")%> - <%=intl._("However, you will get more participating traffic and help the network more if you can open your firewall(s).")%> - <%=intl._("If you think you have already done so, remember that you may have both a hardware and a software firewall, or be behind an additional, institutional firewall you cannot control.")%> - <%=intl._("Also, some routers cannot correctly forward both TCP and UDP on a single port, or may have other limitations or bugs that prevent them from passing traffic through to I2P.")%> -
              • <%=intl._("Testing")%> - - <%=intl._("The router is currently testing whether your UDP port is firewalled.")%> -
              • <%=intl._("Hidden")%> - - <%=intl._("The router is not configured to publish its address, therefore it does not expect incoming connections.")%> - <%=intl._("Hidden mode is automatically enabled for added protection in certain countries.")%> -
              • <%=intl._("WARN - Firewalled and Fast")%> - - <%=intl._("You have configured I2P to share more than 128KBps of bandwidth, but you are firewalled.")%> - <%=intl._("While I2P will work fine in this configuration, if you really have over 128KBps of bandwidth to share, it will be much more helpful to the network if you open your firewall.")%> -
              • <%=intl._("WARN - Firewalled and Floodfill")%> - - <%=intl._("You have configured I2P to be a floodfill router, but you are firewalled.")%> - <%=intl._("For best participation as a floodfill router, you should open your firewall.")%> -
              • <%=intl._("WARN - Firewalled with Inbound TCP Enabled")%> - - <%=intl._("You have configured inbound TCP, however your UDP port is firewalled, and therefore it is likely that your TCP port is firewalled as well.")%> - <%=intl._("If your TCP port is firewalled with inbound TCP enabled, routers will not be able to contact you via TCP, which will hurt the network.")%> - <%=intl._("Please open your firewall or disable inbound TCP above.")%> -
              • <%=intl._("WARN - Firewalled with UDP Disabled")%> - - <%=intl._("You have configured inbound TCP, however you have disabled UDP.")%> - <%=intl._("You appear to be firewalled on TCP, therefore your router cannot accept inbound connections.")%> - <%=intl._("Please open your firewall or enable UDP.")%> -
              • <%=intl._("ERR - Clock Skew")%> - - <%=intl._("Your system's clock is skewed, which will make it difficult to participate in the network.")%> - <%=intl._("Correct your clock setting if this error persists.")%> -
              • <%=intl._("ERR - Private TCP Address")%> - - <%=intl._("You must never advertise an unroutable IP address such as 127.0.0.1 or 192.168.1.1 as your external address.")%> - <%=intl._("Correct the address or disable inbound TCP above.")%> -
              • <%=intl._("ERR - SymmetricNAT")%> - - <%=intl._("I2P detected that you are firewalled by a Symmetric NAT.")%> - <%=intl._("I2P does not work well behind this type of firewall. You will probably not be able to accept inbound connections, which will limit your participation in the network.")%> -
              • <%=intl._("ERR - UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart")%> - - <%=intl._("I2P was unable to bind to the configured port noted on the advanced network configuration page .")%> - <%=intl._("Check to see if another program is using the configured port. If so, stop that program or configure I2P to use a different port.")%> - <%=intl._("This may be a transient error, if the other program is no longer using the port.")%> - <%=intl._("However, a restart is always required after this error.")%> -
              • <%=intl._("ERR - UDP Disabled and Inbound TCP host/port not set")%> - - <%=intl._("You have not configured inbound TCP with a hostname and port above, however you have disabled UDP.")%> - <%=intl._("Therefore your router cannot accept inbound connections.")%> - <%=intl._("Please configure a TCP host and port above or enable UDP.")%> -
              • <%=intl._("ERR - Client Manager I2CP Error - check logs")%> - - <%=intl._("This is usually due to a port 7654 conflict. Check the logs to verify.")%> - <%=intl._("Do you have another I2P instance running? Stop the conflicting program and restart I2P.")%> +
              • <%=intl._t("OK")%> - + <%=intl._t("Your UDP port does not appear to be firewalled.")%> +
              • <%=intl._t("Firewalled")%> - + <%=intl._t("Your UDP port appears to be firewalled.")%> + <%=intl._t("As the firewall detection methods are not 100% reliable, this may occasionally be displayed in error.")%> + <%=intl._t("However, if it appears consistently, you should check whether both your external and internal firewalls are open for your port.")%> + <%=intl._t("I2P will work fine when firewalled, there is no reason for concern. When firewalled, the router uses \"introducers\" to relay inbound connections.")%> + <%=intl._t("However, you will get more participating traffic and help the network more if you can open your firewall(s).")%> + <%=intl._t("If you think you have already done so, remember that you may have both a hardware and a software firewall, or be behind an additional, institutional firewall you cannot control.")%> + <%=intl._t("Also, some routers cannot correctly forward both TCP and UDP on a single port, or may have other limitations or bugs that prevent them from passing traffic through to I2P.")%> +
              • <%=intl._t("Testing")%> - + <%=intl._t("The router is currently testing whether your UDP port is firewalled.")%> +
              • <%=intl._t("Hidden")%> - + <%=intl._t("The router is not configured to publish its address, therefore it does not expect incoming connections.")%> + <%=intl._t("Hidden mode is automatically enabled for added protection in certain countries.")%> +
              • <%=intl._t("WARN - Firewalled and Fast")%> - + <%=intl._t("You have configured I2P to share more than 128KBps of bandwidth, but you are firewalled.")%> + <%=intl._t("While I2P will work fine in this configuration, if you really have over 128KBps of bandwidth to share, it will be much more helpful to the network if you open your firewall.")%> +
              • <%=intl._t("WARN - Firewalled and Floodfill")%> - + <%=intl._t("You have configured I2P to be a floodfill router, but you are firewalled.")%> + <%=intl._t("For best participation as a floodfill router, you should open your firewall.")%> +
              • <%=intl._t("WARN - Firewalled with Inbound TCP Enabled")%> - + <%=intl._t("You have configured inbound TCP, however your UDP port is firewalled, and therefore it is likely that your TCP port is firewalled as well.")%> + <%=intl._t("If your TCP port is firewalled with inbound TCP enabled, routers will not be able to contact you via TCP, which will hurt the network.")%> + <%=intl._t("Please open your firewall or disable inbound TCP above.")%> +
              • <%=intl._t("WARN - Firewalled with UDP Disabled")%> - + <%=intl._t("You have configured inbound TCP, however you have disabled UDP.")%> + <%=intl._t("You appear to be firewalled on TCP, therefore your router cannot accept inbound connections.")%> + <%=intl._t("Please open your firewall or enable UDP.")%> +
              • <%=intl._t("ERR - Clock Skew")%> - + <%=intl._t("Your system's clock is skewed, which will make it difficult to participate in the network.")%> + <%=intl._t("Correct your clock setting if this error persists.")%> +
              • <%=intl._t("ERR - Private TCP Address")%> - + <%=intl._t("You must never advertise an unroutable IP address such as 127.0.0.1 or 192.168.1.1 as your external address.")%> + <%=intl._t("Correct the address or disable inbound TCP above.")%> +
              • <%=intl._t("ERR - SymmetricNAT")%> - + <%=intl._t("I2P detected that you are firewalled by a Symmetric NAT.")%> + <%=intl._t("I2P does not work well behind this type of firewall. You will probably not be able to accept inbound connections, which will limit your participation in the network.")%> +
              • <%=intl._t("ERR - UDP Port In Use - Set i2np.udp.internalPort=xxxx in advanced config and restart")%> - + <%=intl._t("I2P was unable to bind to the configured port noted on the advanced network configuration page .")%> + <%=intl._t("Check to see if another program is using the configured port. If so, stop that program or configure I2P to use a different port.")%> + <%=intl._t("This may be a transient error, if the other program is no longer using the port.")%> + <%=intl._t("However, a restart is always required after this error.")%> +
              • <%=intl._t("ERR - UDP Disabled and Inbound TCP host/port not set")%> - + <%=intl._t("You have not configured inbound TCP with a hostname and port above, however you have disabled UDP.")%> + <%=intl._t("Therefore your router cannot accept inbound connections.")%> + <%=intl._t("Please configure a TCP host and port above or enable UDP.")%> +
              • <%=intl._t("ERR - Client Manager I2CP Error - check logs")%> - + <%=intl._t("This is usually due to a port 7654 conflict. Check the logs to verify.")%> + <%=intl._t("Do you have another I2P instance running? Stop the conflicting program and restart I2P.")%>

              <% /******** <% } %>
              -

              <%=intl._("Adjust Profile Bonuses")%>

              -

              <%=intl._("Bonuses may be positive or negative, and affect the peer's inclusion in Fast and High Capacity tiers. Fast peers are used for client tunnels, and High Capacity peers are used for some exploratory tunnels. Current bonuses are displayed on the")%> <%=intl._("profiles page")%>.

              +

              <%=intl._t("Adjust Profile Bonuses")%>

              +

              <%=intl._t("Bonuses may be positive or negative, and affect the peer's inclusion in Fast and High Capacity tiers. Fast peers are used for client tunnels, and High Capacity peers are used for some exploratory tunnels. Current bonuses are displayed on the")%> <%=intl._t("profiles page")%>.

              <% long speed = 0; long capacity = 0; if (! "".equals(peer)) { // get existing bonus values? } %> -

              <%=intl._("Speed")%>: +

              <%=intl._t("Speed")%>: - <%=intl._("Capacity")%>: + <%=intl._t("Capacity")%>: - " />

              + " />

              -

              <%=intl._("Banned Peers")%>

              +

              <%=intl._t("Banned Peers")%>

              " /> <% profilesHelper.storeWriter(out); %> -

              <%=intl._("Banned IPs")%>

              +

              <%=intl._t("Banned IPs")%>


              diff --git a/apps/routerconsole/jsp/configreseed.jsp b/apps/routerconsole/jsp/configreseed.jsp index de2351e9e9..ebc94b9c9f 100644 --- a/apps/routerconsole/jsp/configreseed.jsp +++ b/apps/routerconsole/jsp/configreseed.jsp @@ -13,107 +13,107 @@ " /> -

              <%=intl._("I2P Reseeding Configuration")%>

              +

              <%=intl._t("I2P Reseeding Configuration")%>

              <%@include file="confignav.jsi" %> <%@include file="formhandler.jsi" %> -

              <%=intl._("Reseeding is the bootstrapping process used to find other routers when you first install I2P, or when your router has too few router references remaining.")%> -<%=intl._("If reseeding has failed, you should first check your network connection.")%> -<%=intl._("See {0} for instructions on reseeding manually.", "" + intl._("the FAQ") + "")%> +

              <%=intl._t("Reseeding is the bootstrapping process used to find other routers when you first install I2P, or when your router has too few router references remaining.")%> +<%=intl._t("If reseeding has failed, you should first check your network connection.")%> +<%=intl._t("See {0} for instructions on reseeding manually.", "" + intl._t("the FAQ") + "")%>

              -

              <%=intl._("Manual Reseed from URL")%>

              -

              <%=intl._("Enter zip or su3 URL")%> : +

              <%=intl._t("Manual Reseed from URL")%>

              +

              <%=intl._t("Enter zip or su3 URL")%> : -
              <%=intl._("The su3 format is preferred, as it will be verified as signed by a trusted source.")%> -<%=intl._("The zip format is unsigned; use a zip file only from a source that you trust.")%> +
              <%=intl._t("The su3 format is preferred, as it will be verified as signed by a trusted source.")%> +<%=intl._t("The zip format is unsigned; use a zip file only from a source that you trust.")%>

              -" /> +" />
              -

              <%=intl._("Manual Reseed from File")%>

              -

              <%=intl._("Select zip or su3 file")%> : +

              <%=intl._t("Manual Reseed from File")%>

              +

              <%=intl._t("Select zip or su3 file")%> : -
              <%=intl._("The su3 format is preferred, as it will be verified as signed by a trusted source.")%> -<%=intl._("The zip format is unsigned; use a zip file only from a source that you trust.")%> +
              <%=intl._t("The su3 format is preferred, as it will be verified as signed by a trusted source.")%> +<%=intl._t("The zip format is unsigned; use a zip file only from a source that you trust.")%>

              -" /> +" />
              -

              <%=intl._("Create Reseed File")%>

              -

              <%=intl._("Create a new reseed zip file you may share for others to reseed manually.")%> -<%=intl._("This file will never contain your own router's identity or IP.")%> +

              <%=intl._t("Create Reseed File")%>

              +

              <%=intl._t("Create a new reseed zip file you may share for others to reseed manually.")%> +<%=intl._t("This file will never contain your own router's identity or IP.")%>

              -" /> +" />
              -

              <%=intl._("Reseeding Configuration")%>

              -

              <%=intl._("The default settings will work for most people.")%> -<%=intl._("Change these only if HTTPS is blocked by a restrictive firewall and reseed has failed.")%> +

              <%=intl._t("Reseeding Configuration")%>

              +

              <%=intl._t("The default settings will work for most people.")%> +<%=intl._t("Change these only if HTTPS is blocked by a restrictive firewall and reseed has failed.")%>

              - + - +<%=intl._t("Use non-SSL only")%> + - + - + - + - + - + - +
              <%=intl._("Reseed URL Selection")%>:
              <%=intl._t("Reseed URL Selection")%>: > -<%=intl._("Try SSL first then non-SSL")%>
              +<%=intl._t("Try SSL first then non-SSL")%>
              > -<%=intl._("Use SSL only")%>
              +<%=intl._t("Use SSL only")%>
              > -<%=intl._("Use non-SSL only")%>
              <%=intl._("Reseed URLs")%>:
              <%=intl._t("Reseed URLs")%>: -
              " />
              +
              " />
              <%=intl._("Enable HTTP Proxy?")%>
              <%=intl._t("Enable HTTP Proxy?")%> >
              <%=intl._("HTTP Proxy Host")%>:
              <%=intl._t("HTTP Proxy Host")%>: " >
              <%=intl._("HTTP Proxy Port")%>:
              <%=intl._t("HTTP Proxy Port")%>: " >
              <%=intl._("Use HTTP Proxy Authorization?")%>
              <%=intl._t("Use HTTP Proxy Authorization?")%> >
              <%=intl._("HTTP Proxy Username")%>:
              <%=intl._t("HTTP Proxy Username")%>: " >
              <%=intl._("HTTP Proxy Password")%>:
              <%=intl._t("HTTP Proxy Password")%>: " >
              -" /> -" /> -" /> +" /> +" /> +" />
              diff --git a/apps/routerconsole/jsp/configservice.jsp b/apps/routerconsole/jsp/configservice.jsp index f12c9b95cb..987aefdeba 100644 --- a/apps/routerconsole/jsp/configservice.jsp +++ b/apps/routerconsole/jsp/configservice.jsp @@ -10,7 +10,7 @@ <%@include file="summary.jsi" %> -

              <%=intl._("I2P Service Configuration")%>

              +

              <%=intl._t("I2P Service Configuration")%>

              <%@include file="confignav.jsi" %> @@ -19,63 +19,63 @@
              -

              <%=intl._("Shutdown the router")%>

              -

              <%=intl._("Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes.")%> - <%=intl._("If you need to kill the router immediately, that option is available as well.")%>

              +

              <%=intl._t("Shutdown the router")%>

              +

              <%=intl._t("Graceful shutdown lets the router satisfy the agreements it has already made before shutting down, but may take a few minutes.")%> + <%=intl._t("If you need to kill the router immediately, that option is available as well.")%>


              - " > - " > + " > + " > <% if (formhandler.shouldShowCancelGraceful()) { %> - " > + " > <% } %>
              <% if (System.getProperty("wrapper.version") != null) { %> -

              <%=intl._("If you want the router to restart itself after shutting down, you can choose one of the following.")%> - <%=intl._("This is useful in some situations - for example, if you changed some settings that client applications only read at startup, such as the routerconsole password or the interface it listens on.")%> - <%=intl._("A graceful restart will take a few minutes (but your peers will appreciate your patience), while a hard restart does so immediately.")%> - <%=intl._("After tearing down the router, it will wait 1 minute before starting back up again.")%>

              +

              <%=intl._t("If you want the router to restart itself after shutting down, you can choose one of the following.")%> + <%=intl._t("This is useful in some situations - for example, if you changed some settings that client applications only read at startup, such as the routerconsole password or the interface it listens on.")%> + <%=intl._t("A graceful restart will take a few minutes (but your peers will appreciate your patience), while a hard restart does so immediately.")%> + <%=intl._t("After tearing down the router, it will wait 1 minute before starting back up again.")%>


              - " > - " > + " > + " > <% } %>
              <% if ( (System.getProperty("os.name") != null) && (System.getProperty("os.name").startsWith("Win")) ) { %> -

              <%=intl._("Systray integration")%>

              -

              <%=intl._("On the windows platform, there is a small application to sit in the system tray, allowing you to view the router's status")%> - <%=intl._("(later on, I2P client applications will be able to integrate their own functionality into the system tray as well).")%> - <%=intl._("If you are on windows, you can either enable or disable that icon here.")%>

              +

              <%=intl._t("Systray integration")%>

              +

              <%=intl._t("On the windows platform, there is a small application to sit in the system tray, allowing you to view the router's status")%> + <%=intl._t("(later on, I2P client applications will be able to integrate their own functionality into the system tray as well).")%> + <%=intl._t("If you are on windows, you can either enable or disable that icon here.")%>


              - " > - " > + " > + " >
              -

              <%=intl._("Run on startup")%>

              -

              <%=intl._("You can control whether I2P is run on startup or not by selecting one of the following options - I2P will install (or remove) a service accordingly.")%> - <%=intl._("If you prefer the command line, you can also run the ")%> install_i2p_service_winnt.bat (<%=intl._("or")%> +

              <%=intl._t("Run on startup")%>

              +

              <%=intl._t("You can control whether I2P is run on startup or not by selecting one of the following options - I2P will install (or remove) a service accordingly.")%> + <%=intl._t("If you prefer the command line, you can also run the ")%> install_i2p_service_winnt.bat (<%=intl._t("or")%> uninstall_i2p_service_winnt.bat).


              - " > -" >
              -

              <%=intl._("Note")%>: <%=intl._("If you are running I2P as service right now, removing it will shut down your router immediately.")%> - <%=intl._("You may want to consider shutting down gracefully, as above, then running uninstall_i2p_service_winnt.bat.")%>

              + " > +" >
              +

              <%=intl._t("Note")%>: <%=intl._t("If you are running I2P as service right now, removing it will shut down your router immediately.")%> + <%=intl._t("You may want to consider shutting down gracefully, as above, then running uninstall_i2p_service_winnt.bat.")%>

              <% } %> -

              <%=intl._("Debugging")%>

              -

              <%=intl._("View the job queue")%> +

              <%=intl._t("Debugging")%>

              +

              <%=intl._t("View the job queue")%> <% if (System.getProperty("wrapper.version") != null) { %> -

              <%=intl._("At times, it may be helpful to debug I2P by getting a thread dump. To do so, please select the following option and review the thread dumped to wrapper.log.")%>

              +

              <%=intl._t("At times, it may be helpful to debug I2P by getting a thread dump. To do so, please select the following option and review the thread dumped to wrapper.log.")%>


              <% } %>
              - " > + " > <% if (System.getProperty("wrapper.version") != null) { %> - " > + " > <% } %>
              -

              <%=intl._("Launch browser on router startup?")%>

              -

              <%=intl._("I2P's main configuration interface is this web console, so for your convenience I2P can launch a web browser on startup pointing at")%> +

              <%=intl._t("Launch browser on router startup?")%>

              +

              <%=intl._t("I2P's main configuration interface is this web console, so for your convenience I2P can launch a web browser on startup pointing at")%> http://127.0.0.1:7657/ .


              - " > - " > + " > + " >
              diff --git a/apps/routerconsole/jsp/configsidebar.jsp b/apps/routerconsole/jsp/configsidebar.jsp index 129feaa107..63c3ed18ce 100644 --- a/apps/routerconsole/jsp/configsidebar.jsp +++ b/apps/routerconsole/jsp/configsidebar.jsp @@ -17,7 +17,7 @@ input.default { <%@include file="summary.jsi" %> -

              <%=intl._("I2P Summary Bar Configuration")%>

              +

              <%=intl._t("I2P Summary Bar Configuration")%>

              <%@include file="confignav.jsi" %> @@ -29,23 +29,23 @@ input.default { " /> -

              <%=intl._("Refresh Interval")%>

              +

              <%=intl._t("Refresh Interval")%>

              " > - <%=intl._("seconds")%> - " > + <%=intl._t("seconds")%> + " >
              -

              <%=intl._("Customize Summary Bar")%>

              +

              <%=intl._t("Customize Summary Bar")%>

              - " > - " > + " > + " >
              diff --git a/apps/routerconsole/jsp/configstats.jsp b/apps/routerconsole/jsp/configstats.jsp index 4100a4b1e2..802d615e5c 100644 --- a/apps/routerconsole/jsp/configstats.jsp +++ b/apps/routerconsole/jsp/configstats.jsp @@ -61,7 +61,7 @@ function toggleAll(category) <%@include file="summary.jsi" %> -

              <%=intl._("I2P Stats Configuration")%>

              +

              <%=intl._t("I2P Stats Configuration")%>

              <%@include file="confignav.jsi" %> @@ -73,44 +73,44 @@ function toggleAll(category)
              -

              <%=intl._("Configure I2P Stat Collection")%>

              -

              <%=intl._("Enable full stats?")%> +

              <%=intl._t("Configure I2P Stat Collection")%>

              +

              <%=intl._t("Enable full stats?")%> checked="checked" <% } %> > - (<%=intl._("change requires restart to take effect")%>)
              + (<%=intl._t("change requires restart to take effect")%>)
              <% // stats.log for devs only and grows without bounds, not recommended boolean shouldShowLog = statshelper.shouldShowLog(); if (shouldShowLog) { -%><%=intl._("Stat file")%>:
              +%><%=intl._t("Stat file")%>:
              Warning - Log with care, stat file grows without limit.
              <% } // shouldShowLog -%><%=intl._("Filter")%>: (<%=intl._("toggle all")%>)

              +%><%=intl._t("Filter")%>: (<%=intl._t("toggle all")%>)

              <% while (statshelper.hasMoreStats()) { while (statshelper.groupRequired()) { %> <% if (shouldShowLog) { -%> +%> <% } // shouldShowLog -%> +%> <% } // end iterating over required groups for the current stat %> @@ -139,14 +139,14 @@ Warning - Log with care, stat file grows without limit.
              %> - <% } // shouldShowLog %>
              > - <%=intl._(statshelper.getCurrentGroupName())%> - (<%=intl._("toggle all")%>) + <%=intl._t(statshelper.getCurrentGroupName())%> + (<%=intl._t("toggle all")%>)
              <%=intl._("Log")%><%=intl._t("Log")%><%=intl._("Graph")%><%=intl._t("Graph")%>
              <%=intl._("Advanced filter")%>: + <%=intl._t("Advanced filter")%>:
              -" > -" > +" > +" >
              diff --git a/apps/routerconsole/jsp/configtunnels.jsp b/apps/routerconsole/jsp/configtunnels.jsp index de82f0027d..09a2ceee97 100644 --- a/apps/routerconsole/jsp/configtunnels.jsp +++ b/apps/routerconsole/jsp/configtunnels.jsp @@ -13,28 +13,28 @@ " /> -

              <%=intl._("I2P Tunnel Configuration")%>

              +

              <%=intl._t("I2P Tunnel Configuration")%>

              <%@include file="confignav.jsi" %> <%@include file="formhandler.jsi" %>

              - <%=intl._("NOTE")%>: - <%=intl._("The default settings work for most people.")%> - <%=intl._("There is a fundamental tradeoff between anonymity and performance.")%> - <%=intl._("Tunnels longer than 3 hops (for example 2 hops + 0-2 hops, 3 hops + 0-1 hops, 3 hops + 0-2 hops), or a high quantity + backup quantity, may severely reduce performance or reliability.")%> - <%=intl._("High CPU and/or high outbound bandwidth usage may result.")%> - <%=intl._("Change these settings with care, and adjust them if you have problems.")%> + <%=intl._t("NOTE")%>: + <%=intl._t("The default settings work for most people.")%> + <%=intl._t("There is a fundamental tradeoff between anonymity and performance.")%> + <%=intl._t("Tunnels longer than 3 hops (for example 2 hops + 0-2 hops, 3 hops + 0-1 hops, 3 hops + 0-2 hops), or a high quantity + backup quantity, may severely reduce performance or reliability.")%> + <%=intl._t("High CPU and/or high outbound bandwidth usage may result.")%> + <%=intl._t("Change these settings with care, and adjust them if you have problems.")%>

              - <%=intl._("Note")%>: <%=intl._("Exploratory tunnel setting changes are stored in the router.config file.")%> - <%=intl._("Client tunnel changes are temporary and are not saved.")%> -<%=intl._("To make permanent client tunnel changes see the")%> <%=intl._("i2ptunnel page")%>. + <%=intl._t("Note")%>: <%=intl._t("Exploratory tunnel setting changes are stored in the router.config file.")%> + <%=intl._t("Client tunnel changes are temporary and are not saved.")%> +<%=intl._t("To make permanent client tunnel changes see the")%> <%=intl._t("i2ptunnel page")%>.
              -" > -" > +" > +" >
              diff --git a/apps/routerconsole/jsp/configui.jsp b/apps/routerconsole/jsp/configui.jsp index 7635ab1e3e..73d0ec565d 100644 --- a/apps/routerconsole/jsp/configui.jsp +++ b/apps/routerconsole/jsp/configui.jsp @@ -22,14 +22,14 @@ input.default { " /> -

              <%=uihelper._("I2P UI Configuration")%>

              +

              <%=uihelper._t("I2P UI Configuration")%>

              <%@include file="confignav.jsi" %> <%@include file="formhandler.jsi" %> -

              <%=uihelper._("Router Console Theme")%>

              +

              <%=uihelper._t("Router Console Theme")%>

              @@ -40,28 +40,28 @@ input.default { %> <% } else { %> -<%=uihelper._("Theme selection disabled for Internet Explorer, sorry.")%> +<%=uihelper._t("Theme selection disabled for Internet Explorer, sorry.")%>
              -<%=uihelper._("If you're not using IE, it's likely that your browser is pretending to be IE; please configure your browser (or proxy) to use a different User Agent string if you'd like to access the console themes.")%> +<%=uihelper._t("If you're not using IE, it's likely that your browser is pretending to be IE; please configure your browser (or proxy) to use a different User Agent string if you'd like to access the console themes.")%> <% } %> -

              <%=uihelper._("Router Console Language")%>

              +

              <%=uihelper._t("Router Console Language")%>

              -

              <%=uihelper._("Please contribute to the router console translation project! Contact the developers in #i2p-dev on IRC to help.")%> +

              <%=uihelper._t("Please contribute to the router console translation project! Contact the developers in #i2p-dev on IRC to help.")%>


              -" > -" > +" > +" >
              -

              <%=uihelper._("Router Console Password")%>

              +

              <%=uihelper._t("Router Console Password")%>

              - " > - " > - " > - " > + " > + " > + " > + " >
              diff --git a/apps/routerconsole/jsp/configupdate.jsp b/apps/routerconsole/jsp/configupdate.jsp index 1171fbcab3..e1e0734043 100644 --- a/apps/routerconsole/jsp/configupdate.jsp +++ b/apps/routerconsole/jsp/configupdate.jsp @@ -11,7 +11,7 @@ <%@include file="summary.jsi" %> -

              <%=intl._("I2P Update Configuration")%>

              +

              <%=intl._t("I2P Update Configuration")%>

              <%@include file="confignav.jsi" %> @@ -27,57 +27,57 @@ <% /* set hidden default */ %> <% if (updatehelper.canInstall()) { %> -

              <%=intl._("Check for I2P and news updates")%>

              +

              <%=intl._t("Check for I2P and news updates")%>

              - + <% } else { %> -

              <%=intl._("Check for news updates")%>

              +

              <%=intl._t("Check for news updates")%>

              <%=intl._("News & I2P Updates")%>:
              <%=intl._t("News & I2P Updates")%>:
              - + <% } // if canInstall %> - - + - <% if (updatehelper.canInstall()) { %> - + <% } // if canInstall %> - + - + <% if (updatehelper.isAdvanced()) { %> - + - + <% } // if isAdvanced %> <% if (updatehelper.canInstall()) { %> <% if (updatehelper.isAdvanced()) { %> - + - + - + - + - + - + <% } // if isAdvanced %> <% } else { %> - + <% } // if canInstall %>
              <%=intl._("News Updates")%>:
              <%=intl._t("News Updates")%>: <% if ("true".equals(System.getProperty("net.i2p.router.web.UpdateHandler.updateInProgress", "false"))) { %> <%=intl._("Update In Progress")%>
              <% } else { %> " /> +
              <% if ("true".equals(System.getProperty("net.i2p.router.web.UpdateHandler.updateInProgress", "false"))) { %> <%=intl._t("Update In Progress")%>
              <% } else { %> " /> <% } %>

              <%=intl._("News URL")%>:
              <%=intl._t("News URL")%>: readonly="readonly"<% } %> value="">
              <%=intl._("Refresh frequency")%>: +
              <%=intl._t("Refresh frequency")%>:
              <%=formhandler._("Update policy")%>:
              <%=formhandler._t("Update policy")%>:
              <%=intl._("Fetch news through the eepProxy?")%>
              <%=intl._t("Fetch news through the eepProxy?")%>
              <%=intl._("Update through the eepProxy?")%>
              <%=intl._t("Update through the eepProxy?")%>
              <%=intl._("eepProxy host")%>:
              <%=intl._t("eepProxy host")%>: " />
              <%=intl._("eepProxy port")%>:
              <%=intl._t("eepProxy port")%>: " />
              <%=intl._("Update URLs")%>:
              <%=intl._t("Update URLs")%>:
              <%=intl._("Trusted keys")%>:
              <%=intl._t("Trusted keys")%>:
              <%=intl._("Update with signed development builds?")%>
              <%=intl._t("Update with signed development builds?")%>
              <%=intl._("Signed Build URL")%>:
              <%=intl._t("Signed Build URL")%>: ">
              <%=intl._("Update with unsigned development builds?")%>
              <%=intl._t("Update with unsigned development builds?")%>
              <%=intl._("Unsigned Build URL")%>:
              <%=intl._t("Unsigned Build URL")%>: ">
              <%=intl._("Updates will be dispatched via your package manager.")%>
              <%=intl._t("Updates will be dispatched via your package manager.")%>
              - " > - " > + " > + " >
              diff --git a/apps/routerconsole/jsp/console.jsp b/apps/routerconsole/jsp/console.jsp index ffed509dd5..1cff1e369e 100644 --- a/apps/routerconsole/jsp/console.jsp +++ b/apps/routerconsole/jsp/console.jsp @@ -15,7 +15,7 @@ <%@include file="summary.jsi" %> -

              <%=intl._("I2P Router Console")%>

              +

              <%=intl._t("I2P Router Console")%>

              <% if (newshelper.shouldShowNews()) { @@ -61,7 +61,7 @@ Tiếng Việt
              -

              <%=intl._("Welcome to I2P")%>

              +

              <%=intl._t("Welcome to I2P")%>

              <% java.io.File fpath = new java.io.File(net.i2p.I2PAppContext.getGlobalContext().getBaseDir(), "docs/readme.html"); %> diff --git a/apps/routerconsole/jsp/dns.jsp b/apps/routerconsole/jsp/dns.jsp index 8080c115b1..23a353416e 100644 --- a/apps/routerconsole/jsp/dns.jsp +++ b/apps/routerconsole/jsp/dns.jsp @@ -30,11 +30,11 @@ <%@include file="summary.jsi" %> -

              <%=intl._("I2P Addressbook")%> ">images/newtab.png" />

              +

              <%=intl._t("I2P Addressbook")%> ">images/newtab.png" />

              <% diff --git a/apps/routerconsole/jsp/error.jsp b/apps/routerconsole/jsp/error.jsp index 5dfba993eb..663b614316 100644 --- a/apps/routerconsole/jsp/error.jsp +++ b/apps/routerconsole/jsp/error.jsp @@ -25,6 +25,6 @@ <%@include file="summary.jsi" %>

              <%=ERROR_CODE%> <%=ERROR_MESSAGE%>

              -<%=intl._("Sorry! You appear to be requesting a non-existent Router Console page or resource.")%>
              -<%=intl._("Error 404")%>: <%=ERROR_URI%> <%=intl._("not found")%>. +<%=intl._t("Sorry! You appear to be requesting a non-existent Router Console page or resource.")%>
              +<%=intl._t("Error 404")%>: <%=ERROR_URI%> <%=intl._t("not found")%>.
              diff --git a/apps/routerconsole/jsp/error500.jsp b/apps/routerconsole/jsp/error500.jsp index 223b4d5de3..c56b1f7ea0 100644 --- a/apps/routerconsole/jsp/error500.jsp +++ b/apps/routerconsole/jsp/error500.jsp @@ -22,26 +22,26 @@

              <%=ERROR_CODE%> <%=ERROR_MESSAGE%>

              -<%=intl._("Sorry! There has been an internal error.")%> +<%=intl._t("Sorry! There has been an internal error.")%>

              <% /* note to translators - both parameters are URLs */ -%><%=intl._("Please report bugs on {0} or {1}.", +%><%=intl._t("Please report bugs on {0} or {1}.", "trac.i2p2.i2p", "trac.i2p2.de")%> -

              <%=intl._("Please include this information in bug reports")%>: +

              <%=intl._t("Please include this information in bug reports")%>:

              -

              <%=intl._("Error Details")%>

              +

              <%=intl._t("Error Details")%>

              -<%=intl._("Error {0}", ERROR_CODE)%>: <%=ERROR_URI%> <%=ERROR_MESSAGE%> +<%=intl._t("Error {0}", ERROR_CODE)%>: <%=ERROR_URI%> <%=ERROR_MESSAGE%>

              <% if (ERROR_THROWABLE != null) { @@ -56,7 +56,7 @@ } %>

              -

              <%=intl._("I2P Version and Running Environment")%>

              +

              <%=intl._t("I2P Version and Running Environment")%>

              I2P version: <%=net.i2p.router.RouterVersion.FULL_VERSION%>
              Java version: <%=System.getProperty("java.vendor")%> <%=System.getProperty("java.version")%> (<%=System.getProperty("java.runtime.name")%> <%=System.getProperty("java.runtime.version")%>)
              @@ -71,5 +71,5 @@ Jbigi: <%=net.i2p.util.NativeBigInteger.loadStatus()%>
              Encoding: <%=System.getProperty("file.encoding")%>
              Charset: <%=java.nio.charset.Charset.defaultCharset().name()%>

              -

              <%=intl._("Note that system information, log timestamps, and log messages may provide clues to your location; please review everything you include in a bug report.")%>

              +

              <%=intl._t("Note that system information, log timestamps, and log messages may provide clues to your location; please review everything you include in a bug report.")%>

              diff --git a/apps/routerconsole/jsp/events.jsp b/apps/routerconsole/jsp/events.jsp index b67aa5dd50..29838e7a78 100644 --- a/apps/routerconsole/jsp/events.jsp +++ b/apps/routerconsole/jsp/events.jsp @@ -18,7 +18,7 @@ <%@include file="summaryajax.jsi" %> <%@include file="summary.jsi" %> -

              <%=intl._("I2P Event Log")%>

              +

              <%=intl._t("I2P Event Log")%>

              diff --git a/apps/routerconsole/jsp/graph.jsp b/apps/routerconsole/jsp/graph.jsp index 92c6f508f8..1d5c5bf1f5 100644 --- a/apps/routerconsole/jsp/graph.jsp +++ b/apps/routerconsole/jsp/graph.jsp @@ -16,7 +16,7 @@ <%@include file="summaryajax.jsi" %> <%@include file="summary.jsi" %> -

              <%=intl._("I2P Performance Graphs")%>

              +

              <%=intl._t("I2P Performance Graphs")%>

              diff --git a/apps/routerconsole/jsp/graphs.jsp b/apps/routerconsole/jsp/graphs.jsp index 8d4aff7526..6cde501311 100644 --- a/apps/routerconsole/jsp/graphs.jsp +++ b/apps/routerconsole/jsp/graphs.jsp @@ -23,7 +23,7 @@ <%@include file="summaryajax.jsi" %> <%@include file="summary.jsi" %> -

              <%=intl._("I2P Performance Graphs")%>

              +

              <%=intl._t("I2P Performance Graphs")%>

              diff --git a/apps/routerconsole/jsp/home.jsp b/apps/routerconsole/jsp/home.jsp index 8553e56e6d..ec00c6b087 100644 --- a/apps/routerconsole/jsp/home.jsp +++ b/apps/routerconsole/jsp/home.jsp @@ -23,12 +23,12 @@ -

              <%=intl._("I2P Router Console")%>

              +

              <%=intl._t("I2P Router Console")%>

              <% if (newshelper.shouldShowNews()) { @@ -57,7 +57,7 @@ " /> <% if (homehelper.shouldShowWelcome()) { %> -
              "> +
              ">
              English عربية @@ -87,7 +87,7 @@ Українська Tiếng Việt
              -

              <%=intl._("Welcome to I2P")%>

              +

              <%=intl._t("Welcome to I2P")%>

              <% } // shouldShowWelcome %> @@ -100,7 +100,7 @@ - - - + + + - + @@ -172,8 +172,8 @@ ${book.loadBookMessages}

              -" > -" > +" > +" >

              @@ -188,14 +188,14 @@ ${book.loadBookMessages} -" /> +" />

              <% /* book.notEmpty */ %>
              -

              <%=intl._("This address book is empty.")%>

              +

              <%=intl._t("This address book is empty.")%>

              @@ -204,16 +204,16 @@ ${book.loadBookMessages}
              -

              <%=intl._("Add new destination")%>:

              +

              <%=intl._t("Add new destination")%>:

              -<%=intl._("Host Name")%> +<%=intl._t("Host Name")%>
              -<%=intl._("Destination")%> +<%=intl._t("Destination")%>

              -" > -" > -" > +" > +" > +" >

              diff --git a/apps/susidns/src/jsp/config.jsp b/apps/susidns/src/jsp/config.jsp index 6a650d3f5d..27e57a6e90 100644 --- a/apps/susidns/src/jsp/config.jsp +++ b/apps/susidns/src/jsp/config.jsp @@ -44,24 +44,24 @@ -<%=intl._("configuration")%> - susidns +<%=intl._t("configuration")%> - susidns


              @@ -74,65 +74,65 @@
              -" > -" > +" > +" >
              -

              <%=intl._("Hints")%>

              +

              <%=intl._t("Hints")%>

              1. -<%=intl._("File and directory paths here are relative to the addressbook's working directory, which is normally ~/.i2p/addressbook/ (Linux) or %APPDATA%\\I2P\\addressbook\\ (Windows).")%> +<%=intl._t("File and directory paths here are relative to the addressbook's working directory, which is normally ~/.i2p/addressbook/ (Linux) or %APPDATA%\\I2P\\addressbook\\ (Windows).")%>
              2. -<%=intl._("If you want to manually add lines to an addressbook, add them to the private or master addressbooks.")%> -<%=intl._("The router addressbook and the published addressbook are updated by the addressbook application.")%> +<%=intl._t("If you want to manually add lines to an addressbook, add them to the private or master addressbooks.")%> +<%=intl._t("The router addressbook and the published addressbook are updated by the addressbook application.")%>
              3. -<%=intl._("When you publish your addressbook, ALL destinations from the master and router addressbooks appear there.")%> -<%=intl._("Use the private addressbook for private destinations, these are not published.")%> +<%=intl._t("When you publish your addressbook, ALL destinations from the master and router addressbooks appear there.")%> +<%=intl._t("Use the private addressbook for private destinations, these are not published.")%>
              -

              <%=intl._("Options")%>

              +

              <%=intl._t("Options")%>

              • subscriptions - -<%=intl._("File containing the list of subscriptions URLs (no need to change)")%> +<%=intl._t("File containing the list of subscriptions URLs (no need to change)")%>
              • update_delay - -<%=intl._("Update interval in hours")%> +<%=intl._t("Update interval in hours")%>
              • published_addressbook - -<%=intl._("Your public hosts.txt file (choose a path within your webserver document root)")%> +<%=intl._t("Your public hosts.txt file (choose a path within your webserver document root)")%>
              • router_addressbook - -<%=intl._("Your hosts.txt (don't change)")%> +<%=intl._t("Your hosts.txt (don't change)")%>
              • master_addressbook - -<%=intl._("Your personal addressbook, these hosts will be published")%> +<%=intl._t("Your personal addressbook, these hosts will be published")%>
              • private_addressbook - -<%=intl._("Your private addressbook, it is never published")%> +<%=intl._t("Your private addressbook, it is never published")%>
              • proxy_port - -<%=intl._("Port for your eepProxy (no need to change)")%> +<%=intl._t("Port for your eepProxy (no need to change)")%>
              • proxy_host - -<%=intl._("Hostname for your eepProxy (no need to change)")%> +<%=intl._t("Hostname for your eepProxy (no need to change)")%>
              • should_publish - -<%=intl._("Whether to update the published addressbook")%> +<%=intl._t("Whether to update the published addressbook")%>
              • etags - -<%=intl._("File containing the etags header from the fetched subscription URLs (no need to change)")%> +<%=intl._t("File containing the etags header from the fetched subscription URLs (no need to change)")%>
              • last_modified - -<%=intl._("File containing the modification timestamp for each fetched subscription URL (no need to change)")%> +<%=intl._t("File containing the modification timestamp for each fetched subscription URL (no need to change)")%>
              • log - -<%=intl._("File to log activity to (change to /dev/null if you like)")%> +<%=intl._t("File to log activity to (change to /dev/null if you like)")%>
              • theme - -<%=intl._("Name of the theme to use (defaults to 'light')")%> +<%=intl._t("Name of the theme to use (defaults to 'light')")%>
              diff --git a/apps/susidns/src/jsp/details.jsp b/apps/susidns/src/jsp/details.jsp index 9334e43ca7..a5660b6773 100644 --- a/apps/susidns/src/jsp/details.jsp +++ b/apps/susidns/src/jsp/details.jsp @@ -42,31 +42,31 @@ -${book.book} <%=intl._("addressbook")%> - susidns +${book.book} <%=intl._t("addressbook")%> - susidns


              -

              <%=intl._("Address book")%>: <%=intl._(book.getBook())%>

              -

              <%=intl._("Storage")%>: ${book.displayName}

              +

              <%=intl._t("Address book")%>: <%=intl._t(book.getBook())%>

              +

              <%=intl._t("Storage")%>: ${book.displayName}

              @@ -85,49 +85,49 @@ - + <% if (addr.isIDN()) { %> - + <% } %> - + - + - - + + - - + + - + - + - + - + - + - + - +
              <%=intl._("Host Name")%><%=intl._t("Host Name")%> <%=addr.getDisplayName()%>
              <%=intl._("Encoded Name")%><%=intl._t("Encoded Name")%> <%=addr.getName()%>
              <%=intl._("Base 32 Address")%><%=intl._t("Base 32 Address")%> <%=b32%>
              <%=intl._("Base 64 Hash")%><%=intl._t("Base 64 Hash")%> <%=addr.getB64()%>
              <%=intl._("Address Helper")%><%=intl._("link")%><%=intl._t("Address Helper")%><%=intl._t("link")%>
              <%=intl._("Public Key")%><%=intl._("ElGamal 2048 bit")%><%=intl._t("Public Key")%><%=intl._t("ElGamal 2048 bit")%>
              <%=intl._("Signing Key")%><%=intl._t("Signing Key")%> <%=addr.getSigType()%>
              <%=intl._("Certificate")%><%=intl._t("Certificate")%> <%=addr.getCert()%>
              <%=intl._("Added Date")%><%=intl._t("Added Date")%> <%=addr.getAdded()%>
              <%=intl._("Source")%><%=intl._t("Source")%> <%=addr.getSource()%>
              <%=intl._("Last Modified")%><%=intl._t("Last Modified")%> <%=addr.getModded()%>
              <%=intl._("Notes")%><%=intl._t("Notes")%> <%=addr.getNotes()%>
              <%=intl._("Destination")%><%=intl._t("Destination")%>
              @@ -138,7 +138,7 @@ -" > +" >

              diff --git a/apps/susidns/src/jsp/index.jsp b/apps/susidns/src/jsp/index.jsp index 505beeec7f..67c96c6801 100644 --- a/apps/susidns/src/jsp/index.jsp +++ b/apps/susidns/src/jsp/index.jsp @@ -42,7 +42,7 @@ -<%=intl._("Introduction")%> - SusiDNS +<%=intl._t("Introduction")%> - SusiDNS @@ -53,39 +53,39 @@

              -

              <%=intl._("What is the addressbook?")%>

              +

              <%=intl._t("What is the addressbook?")%>

              -<%=intl._("The addressbook application is part of your I2P installation.")%> -<%=intl._("It regularly updates your hosts.txt file from distributed sources or \"subscriptions\".")%> +<%=intl._t("The addressbook application is part of your I2P installation.")%> +<%=intl._t("It regularly updates your hosts.txt file from distributed sources or \"subscriptions\".")%>

              -<%=intl._("In the default configuration, the address book is only subscribed to {0}.", "i2p-projekt.i2p")%> -<%=intl._("Subscribing to additional sites is easy, just add them to your subscriptions file.")%> +<%=intl._t("In the default configuration, the address book is only subscribed to {0}.", "i2p-projekt.i2p")%> +<%=intl._t("Subscribing to additional sites is easy, just add them to your subscriptions file.")%>

              -<%=intl._("For more information on naming in I2P, see the overview.")%> +<%=intl._t("For more information on naming in I2P, see the overview.")%>

              -

              <%=intl._("How does the addressbook application work?")%>

              +

              <%=intl._t("How does the addressbook application work?")%>

              -<%=intl._("The addressbook application regularly polls your subscriptions and merges their content into your \"router\" address book.")%> -<%=intl._("Then it merges your \"master\" address book into the router address book as well.")%> -<%=intl._("If configured, the router address book is now written to the \"published\" address book, which will be publicly available if you are running an eepsite.")%> +<%=intl._t("The addressbook application regularly polls your subscriptions and merges their content into your \"router\" address book.")%> +<%=intl._t("Then it merges your \"master\" address book into the router address book as well.")%> +<%=intl._t("If configured, the router address book is now written to the \"published\" address book, which will be publicly available if you are running an eepsite.")%>

              -<%=intl._("The router also uses a private address book (not shown in the picture), which is not merged or published.")%> -<%=intl._("Hosts in the private address book can be accessed by you but their addresses are never distributed to others.")%> -<%=intl._("The private address book can also be used for aliases of hosts in your other address books.")%> +<%=intl._t("The router also uses a private address book (not shown in the picture), which is not merged or published.")%> +<%=intl._t("Hosts in the private address book can be accessed by you but their addresses are never distributed to others.")%> +<%=intl._t("The private address book can also be used for aliases of hosts in your other address books.")%>

              address book working scheme
              diff --git a/apps/susidns/src/jsp/subscriptions.jsp b/apps/susidns/src/jsp/subscriptions.jsp index db588c6a8d..25ec212612 100644 --- a/apps/susidns/src/jsp/subscriptions.jsp +++ b/apps/susidns/src/jsp/subscriptions.jsp @@ -43,24 +43,24 @@ -<%=intl._("subscriptions")%> - susidns +<%=intl._t("subscriptions")%> - susidns


              @@ -73,18 +73,18 @@
              -" > -" > +" > +" >

              -<%=intl._("The subscription file contains a list of i2p URLs.")%> -<%=intl._("The addressbook application regularly checks this list for new eepsites.")%> -<%=intl._("Those URLs refer to published hosts.txt files.")%> -<%=intl._("The default subscription is the hosts.txt from {0}, which is updated infrequently.", "i2p-projekt.i2p")%> -<%=intl._("So it is a good idea to add additional subscriptions to sites that have the latest addresses.")%> -<%=intl._("See the FAQ for a list of subscription URLs.")%> +<%=intl._t("The subscription file contains a list of i2p URLs.")%> +<%=intl._t("The addressbook application regularly checks this list for new eepsites.")%> +<%=intl._t("Those URLs refer to published hosts.txt files.")%> +<%=intl._t("The default subscription is the hosts.txt from {0}, which is updated infrequently.", "i2p-projekt.i2p")%> +<%=intl._t("So it is a good idea to add additional subscriptions to sites that have the latest addresses.")%> +<%=intl._t("See the FAQ for a list of subscription URLs.")%>

              " + _t("No messages") + "
              "); if (i > 0) { out.println( "

              "); if( sessionObject.reallyDelete ) { // TODO ngettext - out.println("

              " + _("Really delete the marked messages?") + - "

              " + button( REALLYDELETE, _("Yes, really delete them!") ) + - "
              " + button( CLEAR, _("Cancel"))); + out.println("

              " + _t("Really delete the marked messages?") + + "

              " + button( REALLYDELETE, _t("Yes, really delete them!") ) + + "
              " + button( CLEAR, _t("Cancel"))); } else { - out.println(button( DELETE, _("Delete Selected") ) + "
              "); + out.println(button( DELETE, _t("Delete Selected") ) + "
              "); out.print( - button( MARKALL, _("Mark All") ) + + button( MARKALL, _t("Mark All") ) + " " + - button( CLEAR, _("Clear All") )); + button( CLEAR, _t("Clear All") )); //"
              " + - //button( INVERT, _("Invert Selection") ) + + //button( INVERT, _t("Invert Selection") ) + //"
              "); } out.print("
              "); // moved to config page //out.print( - // _("Page Size") + ": " + + // _t("Page Size") + ": " + // " " + - // button( SETPAGESIZE, _("Set") ) ); + // button( SETPAGESIZE, _t("Set") ) ); out.print("
              "); - out.print(button(CONFIGURE, _("Settings"))); + out.print(button(CONFIGURE, _t("Settings"))); out.println("
              "); @@ -2303,14 +2303,14 @@ public class WebMail extends HttpServlet out.println( "
              " + ( folder.isFirstPage() ? - button2( FIRSTPAGE, _("First") ) + " " + button2( PREVPAGE, _("Previous") ) : - button( FIRSTPAGE, _("First") ) + " " + button( PREVPAGE, _("Previous") ) ) + + button2( FIRSTPAGE, _t("First") ) + " " + button2( PREVPAGE, _t("Previous") ) : + button( FIRSTPAGE, _t("First") ) + " " + button( PREVPAGE, _t("Previous") ) ) + "      " + - _("Page {0} of {1}", folder.getCurrentPage(), folder.getPages()) + + _t("Page {0} of {1}", folder.getCurrentPage(), folder.getPages()) + "      " + ( folder.isLastPage() ? - button2( NEXTPAGE, _("Next") ) + " " + button2( LASTPAGE, _("Last") ) : - button( NEXTPAGE, _("Next") ) + " " + button( LASTPAGE, _("Last") ) ) + button2( NEXTPAGE, _t("Next") ) + " " + button2( LASTPAGE, _t("Last") ) : + button( NEXTPAGE, _t("Next") ) + " " + button( LASTPAGE, _t("Last") ) ) ); } @@ -2322,7 +2322,7 @@ public class WebMail extends HttpServlet private static void showMessage( PrintWriter out, SessionObject sessionObject ) { if( sessionObject.reallyDelete ) { - out.println( "

              " + _("Really delete this message?") + " " + button( REALLYDELETE, _("Yes, really delete it!") ) + "

              " ); + out.println( "

              " + _t("Really delete this message?") + " " + button( REALLYDELETE, _t("Yes, really delete it!") ) + "

              " ); } Mail mail = sessionObject.mailCache.getMail( sessionObject.showUIDL, MailCache.FetchMode.ALL ); if(!RELEASE && mail != null && mail.hasBody()) { @@ -2334,31 +2334,31 @@ public class WebMail extends HttpServlet out.println( "-->" ); } out.println("
              "); - out.println( button( NEW, _("New") ) + spacer + - button( REPLY, _("Reply") ) + - button( REPLYALL, _("Reply All") ) + - button( FORWARD, _("Forward") ) + spacer + - button( SAVE_AS, _("Save As") ) + spacer); + out.println( button( NEW, _t("New") ) + spacer + + button( REPLY, _t("Reply") ) + + button( REPLYALL, _t("Reply All") ) + + button( FORWARD, _t("Forward") ) + spacer + + button( SAVE_AS, _t("Save As") ) + spacer); if (sessionObject.reallyDelete) - out.println(button2(DELETE, _("Delete"))); + out.println(button2(DELETE, _t("Delete"))); else - out.println(button(DELETE, _("Delete"))); + out.println(button(DELETE, _t("Delete"))); out.println("
              " + - ( sessionObject.folder.isFirstElement( sessionObject.showUIDL ) ? button2( PREV, _("Previous") ) : button( PREV, _("Previous") ) ) + spacer + - button( LIST, _("Back to Folder") ) + spacer + - ( sessionObject.folder.isLastElement( sessionObject.showUIDL ) ? button2( NEXT, _("Next") ) : button( NEXT, _("Next") ) )); + ( sessionObject.folder.isFirstElement( sessionObject.showUIDL ) ? button2( PREV, _t("Previous") ) : button( PREV, _t("Previous") ) ) + spacer + + button( LIST, _t("Back to Folder") ) + spacer + + ( sessionObject.folder.isLastElement( sessionObject.showUIDL ) ? button2( NEXT, _t("Next") ) : button( NEXT, _t("Next") ) )); out.println("
              "); //if (Config.hasConfigFile()) - // out.println(button( RELOAD, _("Reload Config") ) + spacer); - //out.println(button( LOGOUT, _("Logout") ) ); + // out.println(button( RELOAD, _t("Reload Config") ) + spacer); + //out.println(button( LOGOUT, _t("Logout") ) ); if( mail != null ) { out.println( "\n" + "\n" + - "\n" + - "\n" + - "\n" + "" ); if( mail.hasPart()) { @@ -2366,11 +2366,11 @@ public class WebMail extends HttpServlet showPart( out, mail.getPart(), 0, SHOW_HTML ); } else { - out.println( "" ); + out.println( "" ); } } else { - out.println( "" ); + out.println( "" ); } out.println( "\n

              " + _("From") + + "
              " + _t("From") + ":" + quoteHTML( mail.sender ) + "
              " + _("Subject") + + "
              " + _t("Subject") + ":" + quoteHTML( mail.formattedSubject ) + "
              " + _("Date") + + "
              " + _t("Date") + ":" + mail.quotedDate + "

              " + _("Could not fetch mail body.") + "

              " + _t("Could not fetch mail body.") + "

              " + _("Could not fetch mail.") + "

              " + _t("Could not fetch mail.") + "


              " ); } @@ -2388,13 +2388,13 @@ public class WebMail extends HttpServlet sz = Config.getProperty(Folder.PAGESIZE, Folder.DEFAULT_PAGESIZE); out.println("
              "); out.println( - _("Folder Page Size") + ": " + " " + - button( SETPAGESIZE, _("Set") ) ); + button( SETPAGESIZE, _t("Set") ) ); out.println("

              "); out.println("

              "); - out.print(_("Advanced Configuration")); + out.print(_t("Advanced Configuration")); Properties config = Config.getProperties(); out.print(":

              "); out.println("
              "); out.println("
              "); - out.println(button(SAVE, _("Save Configuration"))); - out.println(button(CANCEL, _("Cancel"))); + out.println(button(SAVE, _t("Save Configuration"))); + out.println(button(CANCEL, _t("Cancel"))); out.println("
              "); } /** translate */ - private static String _(String s) { + private static String _t(String s) { return Messages.getString(s); } /** translate */ - private static String _(String s, Object o) { + private static String _t(String s, Object o) { return Messages.getString(s, o); } /** translate */ - private static String _(String s, Object o, Object o2) { + private static String _t(String s, Object o, Object o2) { return Messages.getString(s, o, o2); } diff --git a/apps/susimail/src/src/i2p/susi/webmail/pop3/POP3MailBox.java b/apps/susimail/src/src/i2p/susi/webmail/pop3/POP3MailBox.java index f688ddc16a..5ed2018275 100644 --- a/apps/susimail/src/src/i2p/susi/webmail/pop3/POP3MailBox.java +++ b/apps/susimail/src/src/i2p/susi/webmail/pop3/POP3MailBox.java @@ -99,7 +99,7 @@ public class POP3MailBox implements NewMailListener { sizes = new HashMap(); synchronizer = new Object(); // this appears in the UI so translate - lastLine = _("No response from server"); + lastLine = _t("No response from server"); lastActive = new AtomicLong(System.currentTimeMillis()); lastChecked = new AtomicLong(); delayedDeleter = new DelayedDeleter(this); @@ -665,15 +665,15 @@ public class POP3MailBox implements NewMailListener { idleCloser = new IdleCloser(this); } else { if (lastError.equals("")) - lastError = _("Error connecting to server"); + lastError = _t("Error connecting to server"); close(); } } catch (NumberFormatException e1) { - lastError = _("Error opening mailbox") + ": " + e1; + lastError = _t("Error opening mailbox") + ": " + e1; } catch (IOException e1) { - lastError = _("Error opening mailbox") + ": " + e1.getLocalizedMessage(); + lastError = _t("Error opening mailbox") + ": " + e1.getLocalizedMessage(); } } } @@ -748,7 +748,7 @@ public class POP3MailBox implements NewMailListener { } } else { Debug.debug(Debug.DEBUG, "sendCmd1a: (" + cmd + ") NO RESPONSE"); - lastError = _("No response from server"); + lastError = _t("No response from server"); throw new IOException(lastError); } return result; @@ -790,7 +790,7 @@ public class POP3MailBox implements NewMailListener { String foo = DataHelper.readLine(in); updateActivity(); if (foo == null) { - lastError = _("No response from server"); + lastError = _t("No response from server"); throw new IOException(lastError); } sr.response = foo.trim(); @@ -1022,7 +1022,7 @@ public class POP3MailBox implements NewMailListener { e = e.substring(5); // translate this common error if (e.trim().equals("Login failed.")) - e = _("Login failed"); + e = _t("Login failed"); return e; } @@ -1257,7 +1257,7 @@ public class POP3MailBox implements NewMailListener { } /** translate */ - private static String _(String s) { + private static String _t(String s) { return Messages.getString(s); } } diff --git a/apps/susimail/src/src/i2p/susi/webmail/smtp/SMTPClient.java b/apps/susimail/src/src/i2p/susi/webmail/smtp/SMTPClient.java index f3f7556985..046dcbef52 100644 --- a/apps/susimail/src/src/i2p/susi/webmail/smtp/SMTPClient.java +++ b/apps/susimail/src/src/i2p/susi/webmail/smtp/SMTPClient.java @@ -211,7 +211,7 @@ public class SMTPClient { try { socket = new Socket( host, port ); } catch (Exception e) { - error += _("Cannot connect") + ": " + e.getMessage() + '\n'; + error += _t("Cannot connect") + ": " + e.getMessage() + '\n'; ok = false; } try { @@ -222,7 +222,7 @@ public class SMTPClient { socket.setSoTimeout(120*1000); int result = sendCmd(null); if (result != 220) { - error += _("Server refused connection") + " (" + result + ")\n"; + error += _t("Server refused connection") + " (" + result + ")\n"; ok = false; } } @@ -234,7 +234,7 @@ public class SMTPClient { if (r.result == 250) { supportsPipelining = r.recv.contains("PIPELINING"); } else { - error += _("Server refused connection") + " (" + r.result + ")\n"; + error += _t("Server refused connection") + " (" + r.result + ")\n"; ok = false; } } @@ -246,7 +246,7 @@ public class SMTPClient { cmds.add(new SendExpect(base64.encode(user), 334)); cmds.add(new SendExpect(base64.encode(pass), 235)); if (sendCmds(cmds) != 3) { - error += _("Login failed") + '\n'; + error += _t("Login failed") + '\n'; ok = false; } } @@ -259,7 +259,7 @@ public class SMTPClient { cmds.add(new SendExpect("DATA", 354)); if (sendCmds(cmds) != cmds.size()) { // TODO which recipient? - error += _("Mail rejected") + '\n'; + error += _t("Mail rejected") + '\n'; ok = false; } } @@ -273,10 +273,10 @@ public class SMTPClient { if (result == 250) mailSent = true; else - error += _("Error sending mail") + " (" + result + ")\n"; + error += _t("Error sending mail") + " (" + result + ")\n"; } } catch (IOException e) { - error += _("Error sending mail") + ": " + e.getMessage() + '\n'; + error += _t("Error sending mail") + ": " + e.getMessage() + '\n'; } catch (EncodingException e) { error += e.getMessage(); @@ -324,7 +324,7 @@ public class SMTPClient { } /** translate */ - private static String _(String s) { + private static String _t(String s) { return Messages.getString(s); } } diff --git a/core/java/src/net/i2p/data/DataHelper.java b/core/java/src/net/i2p/data/DataHelper.java index f35a6ddb63..352529a6e0 100644 --- a/core/java/src/net/i2p/data/DataHelper.java +++ b/core/java/src/net/i2p/data/DataHelper.java @@ -1546,7 +1546,7 @@ public class DataHelper { // years t = ngettext("1 year", "{0} years", (int) (ms / (365L * 24 * 60 * 60 * 1000))); } else { - return _("n/a"); + return _t("n/a"); } // Replace minus sign to work around // bug in Chrome (and IE?), line breaks at the minus sign @@ -1593,7 +1593,7 @@ public class DataHelper { // years t = ngettext("1 year", "{0} years", (int) (ms / (365L * 24 * 60 * 60 * 1000))); } else { - return _("n/a"); + return _t("n/a"); } if (ms < 0) t = t.replace("-", "−"); @@ -1602,7 +1602,7 @@ public class DataHelper { private static final String BUNDLE_NAME = "net.i2p.router.web.messages"; - private static String _(String key) { + private static String _t(String key) { return Translate.getString(key, I2PAppContext.getGlobalContext(), BUNDLE_NAME); } diff --git a/core/java/src/net/i2p/util/LogWriterBase.java b/core/java/src/net/i2p/util/LogWriterBase.java index 053cccdc60..08683b6226 100644 --- a/core/java/src/net/i2p/util/LogWriterBase.java +++ b/core/java/src/net/i2p/util/LogWriterBase.java @@ -145,7 +145,7 @@ abstract class LogWriterBase implements Runnable { private String dupMessage(int dupCount, LogRecord lastRecord, boolean reverse) { String arrows = reverse ? "↓↓↓" : "^^^"; return LogRecordFormatter.getWhen(_manager, lastRecord) + ' ' + arrows + ' ' + - _(dupCount, "1 similar message omitted", "{0} similar messages omitted") + ' ' + arrows + '\n'; + _t(dupCount, "1 similar message omitted", "{0} similar messages omitted") + ' ' + arrows + '\n'; } private static final String BUNDLE_NAME = "net.i2p.router.web.messages"; @@ -154,7 +154,7 @@ abstract class LogWriterBase implements Runnable { * gettext * @since 0.9.3 */ - private String _(int a, String b, String c) { + private String _t(int a, String b, String c) { return Translate.getString(a, b, c, _manager.getContext(), BUNDLE_NAME); } diff --git a/core/java/src/net/i2p/util/Translate.java b/core/java/src/net/i2p/util/Translate.java index d83036d02b..3b5ab1b535 100644 --- a/core/java/src/net/i2p/util/Translate.java +++ b/core/java/src/net/i2p/util/Translate.java @@ -65,7 +65,7 @@ public abstract class Translate { * The {0} will be replaced by the parameter. * Single quotes must be doubled, i.e. ' -> '' in the string. * @param o parameter, not translated. - * To tranlslate parameter also, use _("foo {0} bar", _("baz")) + * To tranlslate parameter also, use _t("foo {0} bar", _t("baz")) * Do not double the single quotes in the parameter. * Use autoboxing to call with ints, longs, floats, etc. */ diff --git a/history.txt b/history.txt index b6097d90a4..2a0172d774 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,6 @@ +2015-09-25 dg + * Rename _() for translation to _t() for Java 9 compatibility (ticket #1456) + 2015-09-20 dg * /configreseed: Add 'Reset URL list' button for revert to default hosts (ticket #1554, thanks dzirtt@gmail.com) diff --git a/router/java/src/net/i2p/router/Blocklist.java b/router/java/src/net/i2p/router/Blocklist.java index 4e931f6656..3ad8e73875 100644 --- a/router/java/src/net/i2p/router/Blocklist.java +++ b/router/java/src/net/i2p/router/Blocklist.java @@ -917,7 +917,7 @@ public class Blocklist { singles.addAll(_singleIPBlocklist); if (!(singles.isEmpty() && _singleIPv6Blocklist.isEmpty())) { out.write(""); // first 0 - 127 for (Integer ii : singles) { @@ -954,11 +954,11 @@ public class Blocklist { } if (_blocklistSize > 0) { out.write("
              "); - out.write(_("IPs Banned Until Restart")); + out.write(_t("IPs Banned Until Restart")); out.write("
              "); int max = Math.min(_blocklistSize, MAX_DISPLAY); int displayed = 0; @@ -994,7 +994,7 @@ public class Blocklist { out.write("
              "); - out.write(_("IPs Permanently Banned")); + out.write(_t("IPs Permanently Banned")); out.write("
              "); - out.write(_("From")); + out.write(_t("From")); out.write(""); - out.write(_("To")); + out.write(_t("To")); out.write("
              "); } else { out.write("
              "); - out.write(_("none")); + out.write(_t("none")); out.write(""); } out.flush(); @@ -1030,7 +1030,7 @@ public class Blocklist { private static final String BUNDLE_NAME = "net.i2p.router.web.messages"; /** translate */ - private String _(String key) { + private String _t(String key) { return Translate.getString(key, _context, BUNDLE_NAME); } diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index a6204817e3..f2522cd4ed 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 8; + public final static long BUILD = 9; /** for example "-test" */ public final static String EXTRA = ""; diff --git a/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java b/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java index f619391ecb..bc7b1eeb1e 100644 --- a/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java +++ b/router/java/src/net/i2p/router/networkdb/reseed/Reseeder.java @@ -209,7 +209,7 @@ public class Reseeder { if (fetched <= 0) throw new IOException("No seeds extracted"); _checker.setStatus( - _("Reseeding: got router info from file ({0} successful, {1} errors).", fetched, errors)); + _t("Reseeding: got router info from file ({0} successful, {1} errors).", fetched, errors)); System.err.println("Reseed got " + fetched + " router infos from file with " + errors + " errors"); _context.router().eventLog().addEvent(EventLog.RESEED, fetched + " from file"); return fetched; @@ -281,7 +281,7 @@ public class Reseeder { private void run2() { _isRunning = true; _checker.setError(""); - _checker.setStatus(_("Reseeding")); + _checker.setStatus(_t("Reseeding")); if (_context.getBooleanProperty(PROP_PROXY_ENABLE)) { _proxyHost = _context.getProperty(PROP_PROXY_HOST); _proxyPort = _context.getProperty(PROP_PROXY_PORT, -1); @@ -313,9 +313,9 @@ public class Reseeder { "and if nothing helps, read the FAQ about reseeding manually."); } // else < 0, no valid URLs String old = _checker.getError(); - _checker.setError(_("Reseed failed.") + ' ' + - _("See {0} for help.", - "" + _("reseed configuration page") + "") + + _checker.setError(_t("Reseed failed.") + ' ' + + _t("See {0} for help.", + "" + _t("reseed configuration page") + "") + "
              " + old); } _isRunning = false; @@ -563,7 +563,7 @@ public class Reseeder { try { // Don't use context clock as we may be adjusting the time final long timeLimit = System.currentTimeMillis() + MAX_TIME_PER_HOST; - _checker.setStatus(_("Reseeding: fetching seed URL.")); + _checker.setStatus(_t("Reseeding: fetching seed URL.")); System.err.println("Reseeding from " + seedURL); byte contentRaw[] = readURL(seedURL); if (contentRaw == null) { @@ -620,7 +620,7 @@ public class Reseeder { iter.hasNext() && fetched < 200 && System.currentTimeMillis() < timeLimit; ) { try { _checker.setStatus( - _("Reseeding: fetching router info from seed URL ({0} successful, {1} errors).", fetched, errors)); + _t("Reseeding: fetching router info from seed URL ({0} successful, {1} errors).", fetched, errors)); if (!fetchSeed(seedURL.toString(), iter.next())) continue; @@ -694,7 +694,7 @@ public class Reseeder { int errors = 0; File contentRaw = null; try { - _checker.setStatus(_("Reseeding: fetching seed URL.")); + _checker.setStatus(_t("Reseeding: fetching seed URL.")); System.err.println("Reseeding from " + seedURL); // don't use context time, as we may be step-changing it // from the server header @@ -730,7 +730,7 @@ public class Reseeder { contentRaw.delete(); } _checker.setStatus( - _("Reseeding: fetching router info from seed URL ({0} successful, {1} errors).", fetched, errors)); + _t("Reseeding: fetching router info from seed URL ({0} successful, {1} errors).", fetched, errors)); System.err.println("Reseed got " + fetched + " router infos from " + seedURL + " with " + errors + " errors"); return fetched; } @@ -1002,17 +1002,17 @@ public class Reseeder { private static final String BUNDLE_NAME = "net.i2p.router.web.messages"; /** translate */ - private String _(String key) { + private String _t(String key) { return Translate.getString(key, _context, BUNDLE_NAME); } /** translate */ - private String _(String s, Object o) { + private String _t(String s, Object o) { return Translate.getString(s, o, _context, BUNDLE_NAME); } /** translate */ - private String _(String s, Object o, Object o2) { + private String _t(String s, Object o, Object o2) { return Translate.getString(s, o, o2, _context, BUNDLE_NAME); } diff --git a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java index a9b8020607..fbea029908 100644 --- a/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java +++ b/router/java/src/net/i2p/router/transport/CommSystemFacadeImpl.java @@ -499,7 +499,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade { buf.append(""); boolean found = _context.netDb().lookupRouterInfoLocally(peer) != null; if (found) - buf.append(""); + buf.append(""); buf.append(h); if (found) buf.append(""); @@ -519,7 +519,7 @@ public class CommSystemFacadeImpl extends CommSystemFacade { /** * Translate */ - private final String _(String s) { + private final String _t(String s) { return Translate.getString(s, _context, BUNDLE_NAME); } diff --git a/router/java/src/net/i2p/router/transport/TransportImpl.java b/router/java/src/net/i2p/router/transport/TransportImpl.java index ce2d643a6c..11fb08b96a 100644 --- a/router/java/src/net/i2p/router/transport/TransportImpl.java +++ b/router/java/src/net/i2p/router/transport/TransportImpl.java @@ -983,7 +983,7 @@ public abstract class TransportImpl implements Transport { * Translate * @since 0.9.8 moved from transports */ - protected String _(String s) { + protected String _t(String s) { return Translate.getString(s, _context, BUNDLE_NAME); } @@ -991,7 +991,7 @@ public abstract class TransportImpl implements Transport { * Translate * @since 0.9.8 moved from transports */ - protected String _(String s, Object o) { + protected String _t(String s, Object o) { return Translate.getString(s, o, _context, BUNDLE_NAME); } diff --git a/router/java/src/net/i2p/router/transport/TransportManager.java b/router/java/src/net/i2p/router/transport/TransportManager.java index 4c0f325bbb..b49ff15514 100644 --- a/router/java/src/net/i2p/router/transport/TransportManager.java +++ b/router/java/src/net/i2p/router/transport/TransportManager.java @@ -671,9 +671,9 @@ public class TransportManager implements TransportEventListener { public void renderStatusHTML(Writer out, String urlBase, int sortFlags) throws IOException { if (_context.getBooleanProperty(PROP_ADVANCED)) { out.write("

              "); - out.write(_("Status")); + out.write(_t("Status")); out.write(": "); - out.write(_(getReachabilityStatus().toStatusString())); + out.write(_t(getReachabilityStatus().toStatusString())); out.write("

              "); } TreeMap transports = new TreeMap(); @@ -689,7 +689,7 @@ public class TransportManager implements TransportEventListener { } StringBuilder buf = new StringBuilder(4*1024); - buf.append("

              ").append(_("Router Transport Addresses")).append("

              \n");
              +        buf.append("

              ").append(_t("Router Transport Addresses")).append("

              \n");
                       for (Transport t : _transports.values()) {
                           if (t.hasCurrentAddress()) {
                               for (RouterAddress ra : t.getCurrentAddresses()) {
              @@ -697,7 +697,7 @@ public class TransportManager implements TransportEventListener {
                                   buf.append("\n\n");
                               }
                           } else {
              -                buf.append(_("{0} is used for outbound connections only", t.getStyle()));
              +                buf.append(_t("{0} is used for outbound connections only", t.getStyle()));
                               buf.append("\n\n");
                           }
                       }
              @@ -708,7 +708,7 @@ public class TransportManager implements TransportEventListener {
                       } else if (_upnpManager != null) {
                           out.write(_upnpManager.renderStatusHTML());
                       } else {
              -            out.write("

              " + _("UPnP is not enabled") + "

              \n"); + out.write("

              " + _t("UPnP is not enabled") + "

              \n"); } out.write("

              \n"); out.flush(); @@ -717,38 +717,38 @@ public class TransportManager implements TransportEventListener { private final String getTransportsLegend() { StringBuilder buf = new StringBuilder(1024); - buf.append("

              ").append(_("Help")).append("

              ") - .append(_("Your transport connection limits are automatically set based on your configured bandwidth.")) + buf.append("

              ").append(_t("Help")).append("

              ") + .append(_t("Your transport connection limits are automatically set based on your configured bandwidth.")) .append('\n') - .append(_("To override these limits, add the settings i2np.ntcp.maxConnections=nnn and i2np.udp.maxConnections=nnn on the advanced configuration page.")) + .append(_t("To override these limits, add the settings i2np.ntcp.maxConnections=nnn and i2np.udp.maxConnections=nnn on the advanced configuration page.")) .append("

              \n"); - buf.append("

              ").append(_("Definitions")).append("

              " + - "

              ").append(_("Peer")).append(": ").append(_("The remote peer, identified by router hash")).append("
              \n" + - "").append(_("Dir")).append(": " + - "\"Inbound\" ").append(_("Inbound connection")).append("
              \n" + + buf.append("

              ").append(_t("Definitions")).append("

              " + + "

              ").append(_t("Peer")).append(": ").append(_t("The remote peer, identified by router hash")).append("
              \n" + + "").append(_t("Dir")).append(": " + + "\"Inbound\" ").append(_t("Inbound connection")).append("
              \n" + "       " + - "\"Outbound\" ").append(_("Outbound connection")).append("
              \n" + + "\"Outbound\" ").append(_t("Outbound connection")).append("
              \n" + "       " + - "\"V\" ").append(_("They offered to introduce us (help other peers traverse our firewall)")).append("
              \n" + + "\"V\" ").append(_t("They offered to introduce us (help other peers traverse our firewall)")).append("
              \n" + "       " + - "\"^\" ").append(_("We offered to introduce them (help other peers traverse their firewall)")).append("
              \n" + - "").append(_("Idle")).append(": ").append(_("How long since a packet has been received / sent")).append("
              \n" + - "").append(_("In/Out")).append(": ").append(_("The smoothed inbound / outbound transfer rate (KBytes per second)")).append("
              \n" + - "").append(_("Up")).append(": ").append(_("How long ago this connection was established")).append("
              \n" + - "").append(_("Skew")).append(": ").append(_("The difference between the peer's clock and your own")).append("
              \n" + - "CWND: ").append(_("The congestion window, which is how many bytes can be sent without an acknowledgement")).append(" /
              \n" + - "        ").append(_("The number of sent messages awaiting acknowledgement")).append(" /
              \n" + - "        ").append(_("The maximum number of concurrent messages to send")).append(" /
              \n"+ - "        ").append(_("The number of pending sends which exceed congestion window")).append("
              \n" + - "SST: ").append(_("The slow start threshold")).append("
              \n" + - "RTT: ").append(_("The round trip time in milliseconds")).append("
              \n" + - //"").append(_("Dev")).append(": ").append(_("The standard deviation of the round trip time in milliseconds")).append("
              \n" + - "RTO: ").append(_("The retransmit timeout in milliseconds")).append("
              \n" + - "MTU: ").append(_("Current maximum send packet size / estimated maximum receive packet size (bytes)")).append("
              \n" + - "").append(_("TX")).append(": ").append(_("The total number of packets sent to the peer")).append("
              \n" + - "").append(_("RX")).append(": ").append(_("The total number of packets received from the peer")).append("
              \n" + - "").append(_("Dup TX")).append(": ").append(_("The total number of packets retransmitted to the peer")).append("
              \n" + - "").append(_("Dup RX")).append(": ").append(_("The total number of duplicate packets received from the peer")).append("

              " + + "\"^\" ").append(_t("We offered to introduce them (help other peers traverse their firewall)")).append("
              \n" + + "").append(_t("Idle")).append(": ").append(_t("How long since a packet has been received / sent")).append("
              \n" + + "").append(_t("In/Out")).append(": ").append(_t("The smoothed inbound / outbound transfer rate (KBytes per second)")).append("
              \n" + + "").append(_t("Up")).append(": ").append(_t("How long ago this connection was established")).append("
              \n" + + "").append(_t("Skew")).append(": ").append(_t("The difference between the peer's clock and your own")).append("
              \n" + + "CWND: ").append(_t("The congestion window, which is how many bytes can be sent without an acknowledgement")).append(" /
              \n" + + "        ").append(_t("The number of sent messages awaiting acknowledgement")).append(" /
              \n" + + "        ").append(_t("The maximum number of concurrent messages to send")).append(" /
              \n"+ + "        ").append(_t("The number of pending sends which exceed congestion window")).append("
              \n" + + "SST: ").append(_t("The slow start threshold")).append("
              \n" + + "RTT: ").append(_t("The round trip time in milliseconds")).append("
              \n" + + //"").append(_t("Dev")).append(": ").append(_t("The standard deviation of the round trip time in milliseconds")).append("
              \n" + + "RTO: ").append(_t("The retransmit timeout in milliseconds")).append("
              \n" + + "MTU: ").append(_t("Current maximum send packet size / estimated maximum receive packet size (bytes)")).append("
              \n" + + "").append(_t("TX")).append(": ").append(_t("The total number of packets sent to the peer")).append("
              \n" + + "").append(_t("RX")).append(": ").append(_t("The total number of packets received from the peer")).append("
              \n" + + "").append(_t("Dup TX")).append(": ").append(_t("The total number of packets retransmitted to the peer")).append("
              \n" + + "").append(_t("Dup RX")).append(": ").append(_t("The total number of duplicate packets received from the peer")).append("

              " + "
              \n"); return buf.toString(); } @@ -770,14 +770,14 @@ public class TransportManager implements TransportEventListener { /** * Translate */ - private final String _(String s) { + private final String _t(String s) { return Translate.getString(s, _context, BUNDLE_NAME); } /** * Translate */ - private final String _(String s, Object o) { + private final String _t(String s, Object o) { return Translate.getString(s, o, _context, BUNDLE_NAME); } } diff --git a/router/java/src/net/i2p/router/transport/UPnP.java b/router/java/src/net/i2p/router/transport/UPnP.java index 29e0a037c0..baec7ab621 100644 --- a/router/java/src/net/i2p/router/transport/UPnP.java +++ b/router/java/src/net/i2p/router/transport/UPnP.java @@ -557,68 +557,68 @@ class UPnP extends ControlPoint implements DeviceChangeListener, EventListener { for(int i=0; i").append(_("Service")).append(": "); + sb.append("
            3. ").append(_t("Service")).append(": "); // NOTE: Group all toString() of common actions together // to avoid excess fetches, since toString() caches. if("urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1".equals(serv.getServiceType())){ - sb.append(_("WAN Common Interface Configuration")); - sb.append("
              • ").append(_("Status")).append(": ") + sb.append(_t("WAN Common Interface Configuration")); + sb.append("
                • ").append(_t("Status")).append(": ") .append(toString("GetCommonLinkProperties", "NewPhysicalLinkStatus", serv)); - sb.append("
                • ").append(_("Type")).append(": ") + sb.append("
                • ").append(_t("Type")).append(": ") .append(toString("GetCommonLinkProperties", "NewWANAccessType", serv)); - sb.append("
                • ").append(_("Upstream")).append(": ") + sb.append("
                • ").append(_t("Upstream")).append(": ") .append(toString("GetCommonLinkProperties", "NewLayer1UpstreamMaxBitRate", serv)); - sb.append("
                • ").append(_("Downstream")).append(": ") + sb.append("
                • ").append(_t("Downstream")).append(": ") .append(toString("GetCommonLinkProperties", "NewLayer1DownstreamMaxBitRate", serv)) .append("
                • "); }else if("urn:schemas-upnp-org:service:WANPPPConnection:1".equals(serv.getServiceType())){ - sb.append(_("WAN PPP Connection")); - sb.append("
                  • ").append(_("Status")).append(": ") + sb.append(_t("WAN PPP Connection")); + sb.append("
                    • ").append(_t("Status")).append(": ") .append(toString("GetStatusInfo", "NewConnectionStatus", serv)); String up = toString("GetStatusInfo", "NewUptime", serv); if (up != null) { try { long uptime = Long.parseLong(up); uptime *= 1000; - sb.append("
                    • ").append(_("Uptime")).append(": ") + sb.append("
                    • ").append(_t("Uptime")).append(": ") .append(DataHelper.formatDuration2(uptime)); } catch (NumberFormatException nfe) {} } - sb.append("
                    • ").append(_("Type")).append(": ") + sb.append("
                    • ").append(_t("Type")).append(": ") .append(toString("GetConnectionTypeInfo", "NewConnectionType", serv)); - sb.append("
                    • ").append(_("Upstream")).append(": ") + sb.append("
                    • ").append(_t("Upstream")).append(": ") .append(toString("GetLinkLayerMaxBitRates", "NewUpstreamMaxBitRate", serv)); - sb.append("
                    • ").append(_("Downstream")).append(": ") + sb.append("
                    • ").append(_t("Downstream")).append(": ") .append(toString("GetLinkLayerMaxBitRates", "NewDownstreamMaxBitRate", serv) + "
                      "); - sb.append("
                    • ").append(_("External IP")).append(": ") + sb.append("
                    • ").append(_t("External IP")).append(": ") .append(toString("GetExternalIPAddress", "NewExternalIPAddress", serv)) .append("
                    • "); }else if("urn:schemas-upnp-org:service:Layer3Forwarding:1".equals(serv.getServiceType())){ - sb.append(_("Layer 3 Forwarding")); - sb.append("
                      • ").append(_("Default Connection Service")).append(": ") + sb.append(_t("Layer 3 Forwarding")); + sb.append("
                        • ").append(_t("Default Connection Service")).append(": ") .append(toString("GetDefaultConnectionService", "NewDefaultConnectionService", serv)) .append("
                        • "); }else if(WAN_IP_CONNECTION.equals(serv.getServiceType())){ - sb.append(_("WAN IP Connection")); - sb.append("
                          • ").append(_("Status")).append(": ") + sb.append(_t("WAN IP Connection")); + sb.append("
                            • ").append(_t("Status")).append(": ") .append(toString("GetStatusInfo", "NewConnectionStatus", serv)); String up = toString("GetStatusInfo", "NewUptime", serv); if (up != null) { try { long uptime = Long.parseLong(up); uptime *= 1000; - sb.append("
                            • ").append(_("Uptime")).append(": ") + sb.append("
                            • ").append(_t("Uptime")).append(": ") .append(DataHelper.formatDuration2(uptime)); } catch (NumberFormatException nfe) {} } - sb.append("
                            • ").append(_("Type")).append(": ") + sb.append("
                            • ").append(_t("Type")).append(": ") .append(toString("GetConnectionTypeInfo", "NewConnectionType", serv)); - sb.append("
                            • ").append(_("External IP")).append(": ") + sb.append("
                            • ").append(_t("External IP")).append(": ") .append(toString("GetExternalIPAddress", "NewExternalIPAddress", serv)) .append("
                            • "); }else if("urn:schemas-upnp-org:service:WANEthernetLinkConfig:1".equals(serv.getServiceType())){ - sb.append(_("WAN Ethernet Link Configuration")); - sb.append("
                              • ").append(_("Status")).append(": ") + sb.append(_t("WAN Ethernet Link Configuration")); + sb.append("
                                • ").append(_t("Status")).append(": ") .append(toString("GetEthernetLinkStatus", "NewEthernetLinkStatus", serv)) .append("
                                • "); } else { @@ -638,9 +638,9 @@ class UPnP extends ControlPoint implements DeviceChangeListener, EventListener { private void listSubDev(String prefix, Device dev, StringBuilder sb){ if (prefix == null) - sb.append("

                                  ").append(_("Found Device")).append(": "); + sb.append("

                                  ").append(_t("Found Device")).append(": "); else - sb.append("

                                • ").append(_("Subdevice")).append(": "); + sb.append("
                                • ").append(_t("Subdevice")).append(": "); sb.append(DataHelper.escapeHTML(dev.getFriendlyName())); if (prefix == null) sb.append("

                                  "); @@ -661,11 +661,11 @@ class UPnP extends ControlPoint implements DeviceChangeListener, EventListener { /** warning - slow */ public String renderStatusHTML() { final StringBuilder sb = new StringBuilder(); - sb.append("

                                  ").append(_("UPnP Status")).append("

                                  "); + sb.append("

                                  ").append(_t("UPnP Status")).append("

                                  "); synchronized(_otherUDNs) { if (!_otherUDNs.isEmpty()) { - sb.append(_("Disabled UPnP Devices")); + sb.append(_t("Disabled UPnP Devices")); sb.append("
                                    "); for (Map.Entry e : _otherUDNs.entrySet()) { String udn = e.getKey(); @@ -679,10 +679,10 @@ class UPnP extends ControlPoint implements DeviceChangeListener, EventListener { } if(isDisabled) { - sb.append(_("UPnP has been disabled; Do you have more than one UPnP Internet Gateway Device on your LAN ?")); + sb.append(_t("UPnP has been disabled; Do you have more than one UPnP Internet Gateway Device on your LAN ?")); return sb.toString(); } else if(!isNATPresent()) { - sb.append(_("UPnP has not found any UPnP-aware, compatible device on your LAN.")); + sb.append(_t("UPnP has not found any UPnP-aware, compatible device on your LAN.")); return sb.toString(); } @@ -690,15 +690,15 @@ class UPnP extends ControlPoint implements DeviceChangeListener, EventListener { String addr = getNATAddress(); sb.append("

                                    "); if (addr != null) - sb.append(_("The current external IP address reported by UPnP is {0}", DataHelper.escapeHTML(addr))); + sb.append(_t("The current external IP address reported by UPnP is {0}", DataHelper.escapeHTML(addr))); else - sb.append(_("The current external IP address is not available.")); + sb.append(_t("The current external IP address is not available.")); int downstreamMaxBitRate = getDownstreamMaxBitRate(); int upstreamMaxBitRate = getUpstreamMaxBitRate(); if(downstreamMaxBitRate > 0) - sb.append("
                                    ").append(_("UPnP reports the maximum downstream bit rate is {0}bits/sec", DataHelper.formatSize2(downstreamMaxBitRate))); + sb.append("
                                    ").append(_t("UPnP reports the maximum downstream bit rate is {0}bits/sec", DataHelper.formatSize2(downstreamMaxBitRate))); if(upstreamMaxBitRate > 0) - sb.append("
                                    ").append(_("UPnP reports the maximum upstream bit rate is {0}bits/sec", DataHelper.formatSize2(upstreamMaxBitRate))); + sb.append("
                                    ").append(_t("UPnP reports the maximum upstream bit rate is {0}bits/sec", DataHelper.formatSize2(upstreamMaxBitRate))); synchronized(lock) { for(ForwardPort port : portsToForward) { sb.append("
                                    "); @@ -706,9 +706,9 @@ class UPnP extends ControlPoint implements DeviceChangeListener, EventListener { // {0} is TCP or UDP // {1,number,#####} prevents 12345 from being output as 12,345 in the English locale. // If you want the digit separator in your locale, translate as {1}. - sb.append(_("{0} port {1,number,#####} was successfully forwarded by UPnP.", protoToString(port.protocol), port.portNumber)); + sb.append(_t("{0} port {1,number,#####} was successfully forwarded by UPnP.", protoToString(port.protocol), port.portNumber)); else - sb.append(_("{0} port {1,number,#####} was not forwarded by UPnP.", protoToString(port.protocol), port.portNumber)); + sb.append(_t("{0} port {1,number,#####} was not forwarded by UPnP.", protoToString(port.protocol), port.portNumber)); } } @@ -1101,21 +1101,21 @@ class UPnP extends ControlPoint implements DeviceChangeListener, EventListener { /** * Translate */ - private final String _(String s) { + private final String _t(String s) { return Translate.getString(s, _context, BUNDLE_NAME); } /** * Translate */ - private final String _(String s, Object o) { + private final String _t(String s, Object o) { return Translate.getString(s, o, _context, BUNDLE_NAME); } /** * Translate */ - private final String _(String s, Object o, Object o2) { + private final String _t(String s, Object o, Object o2) { return Translate.getString(s, o, o2, _context, BUNDLE_NAME); } } diff --git a/router/java/src/net/i2p/router/transport/UPnPManager.java b/router/java/src/net/i2p/router/transport/UPnPManager.java index 0ff6d5d848..370ba813e8 100644 --- a/router/java/src/net/i2p/router/transport/UPnPManager.java +++ b/router/java/src/net/i2p/router/transport/UPnPManager.java @@ -280,7 +280,7 @@ class UPnPManager { */ public String renderStatusHTML() { if (!_isRunning) - return "

                                    " + _("UPnP is not enabled") + "

                                    \n"; + return "

                                    " + _t("UPnP is not enabled") + "

                                    \n"; return _upnp.renderStatusHTML(); } @@ -289,7 +289,7 @@ class UPnPManager { /** * Translate */ - private final String _(String s) { + private final String _t(String s) { return Translate.getString(s, _context, BUNDLE_NAME); } diff --git a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java index 382d4d89e4..c38e932d5b 100644 --- a/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java +++ b/router/java/src/net/i2p/router/transport/ntcp/NTCPTransport.java @@ -1341,26 +1341,26 @@ public class NTCPTransport extends TransportImpl { } StringBuilder buf = new StringBuilder(512); - buf.append("

                                    ").append(_("NTCP connections")).append(": ").append(peers.size()); - buf.append(". ").append(_("Limit")).append(": ").append(getMaxConnections()); - buf.append(". ").append(_("Timeout")).append(": ").append(DataHelper.formatDuration2(_pumper.getIdleTimeout())); + buf.append("

                                    ").append(_t("NTCP connections")).append(": ").append(peers.size()); + buf.append(". ").append(_t("Limit")).append(": ").append(getMaxConnections()); + buf.append(". ").append(_t("Timeout")).append(": ").append(DataHelper.formatDuration2(_pumper.getIdleTimeout())); if (_context.getBooleanProperty(PROP_ADVANCED)) { - buf.append(". ").append(_("Status")).append(": ").append(_(getReachabilityStatus().toStatusString())); + buf.append(". ").append(_t("Status")).append(": ").append(_t(getReachabilityStatus().toStatusString())); } buf.append(".

                                    \n" + "\n" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - "" + - //"" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + "" + + //"" + " \n"); out.write(buf.toString()); buf.setLength(0); @@ -1372,9 +1372,9 @@ public class NTCPTransport extends TransportImpl { // buf.append(' ').append(_context.blocklist().toStr(ip)); buf.append("
                                    ").append(_("Peer")).append("").append(_("Dir")).append("").append(_("IPv6")).append("").append(_("Idle")).append("").append(_("In/Out")).append("").append(_("Up")).append("").append(_("Skew")).append("").append(_("TX")).append("").append(_("RX")).append("").append(_("Out Queue")).append("").append(_("Backlogged?")).append("").append(_("Reading?")).append("
                                    ").append(_t("Peer")).append("").append(_t("Dir")).append("").append(_t("IPv6")).append("").append(_t("Idle")).append("").append(_t("In/Out")).append("").append(_t("Up")).append("").append(_t("Skew")).append("").append(_t("TX")).append("").append(_t("RX")).append("").append(_t("Out Queue")).append("").append(_t("Backlogged?")).append("").append(_t("Reading?")).append("
                                    "); if (con.isInbound()) - buf.append("\"Inbound\""); + buf.append("\"Inbound\""); else - buf.append("\"Outbound\""); + buf.append("\"Outbound\""); buf.append(""); if (con.isIPv6()) buf.append("✓"); diff --git a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java index d109cb0991..223f655f5a 100644 --- a/router/java/src/net/i2p/router/transport/udp/UDPTransport.java +++ b/router/java/src/net/i2p/router/transport/udp/UDPTransport.java @@ -2465,58 +2465,58 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority int numPeers = 0; StringBuilder buf = new StringBuilder(512); - buf.append("

                                    ").append(_("UDP connections")).append(": ").append(peers.size()); - buf.append(". ").append(_("Limit")).append(": ").append(getMaxConnections()); - buf.append(". ").append(_("Timeout")).append(": ").append(DataHelper.formatDuration2(_expireTimeout)); + buf.append("

                                    ").append(_t("UDP connections")).append(": ").append(peers.size()); + buf.append(". ").append(_t("Limit")).append(": ").append(getMaxConnections()); + buf.append(". ").append(_t("Timeout")).append(": ").append(DataHelper.formatDuration2(_expireTimeout)); if (_context.getBooleanProperty(PROP_ADVANCED)) { - buf.append(". ").append(_("Status")).append(": ").append(_(_reachabilityStatus.toStatusString())); + buf.append(". ").append(_t("Status")).append(": ").append(_t(_reachabilityStatus.toStatusString())); } buf.append(".

                                    \n"); buf.append("\n"); - buf.append(""); - buf.append("\n"); - buf.append("\n"); buf.append("\n"); buf.append("\n"); buf.append("\n"); - buf.append("\n"); out.write(buf.toString()); buf.setLength(0); @@ -2532,17 +2532,17 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority // buf.append(' ').append(_context.blocklist().toStr(ip)); buf.append(""); buf.append("
                                    ").append(_("Peer")).append("
                                    "); + buf.append("
                                    ").append(_t("Peer")).append("
                                    "); if (sortFlags != FLAG_ALPHA) - appendSortLinks(buf, urlBase, sortFlags, _("Sort by peer hash"), FLAG_ALPHA); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by peer hash"), FLAG_ALPHA); buf.append("
                                    ").append(_("Dir")) - .append("").append(_("IPv6")) - .append("").append(_("Idle")).append("
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by idle inbound"), FLAG_IDLE_IN); + .append(_t("Direction/Introduction")).append("\">").append(_t("Dir")) + .append("
                                    ").append(_t("IPv6")) + .append("").append(_t("Idle")).append("
                                    "); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by idle inbound"), FLAG_IDLE_IN); buf.append(" / "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by idle outbound"), FLAG_IDLE_OUT); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by idle outbound"), FLAG_IDLE_OUT); buf.append("
                                    ").append(_("In/Out")).append("
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by inbound rate"), FLAG_RATE_IN); + buf.append("
                                    ").append(_t("In/Out")).append("
                                    "); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by inbound rate"), FLAG_RATE_IN); buf.append(" / "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by outbound rate"), FLAG_RATE_OUT); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by outbound rate"), FLAG_RATE_OUT); buf.append("
                                    ").append(_("Up")).append("
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by connection uptime"), FLAG_UPTIME); - buf.append("
                                    ").append(_("Skew")).append("
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by clock skew"), FLAG_SKEW); + buf.append("
                                    ").append(_t("Up")).append("
                                    "); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by connection uptime"), FLAG_UPTIME); + buf.append("
                                    ").append(_t("Skew")).append("
                                    "); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by clock skew"), FLAG_SKEW); buf.append("
                                    CWND
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by congestion window"), FLAG_CWND); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by congestion window"), FLAG_CWND); buf.append("
                                    SST
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by slow start threshold"), FLAG_SSTHRESH); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by slow start threshold"), FLAG_SSTHRESH); buf.append("
                                    RTT
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by round trip time"), FLAG_RTT); - //buf.append("
                                    ").append(_("Dev")).append("
                                    "); - //appendSortLinks(buf, urlBase, sortFlags, _("Sort by round trip time deviation"), FLAG_DEV); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time"), FLAG_RTT); + //buf.append("
                                    ").append(_t("Dev")).append("
                                    "); + //appendSortLinks(buf, urlBase, sortFlags, _t("Sort by round trip time deviation"), FLAG_DEV); buf.append("
                                    RTO
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by retransmission timeout"), FLAG_RTO); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by retransmission timeout"), FLAG_RTO); buf.append("
                                    MTU
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by outbound maximum transmit unit"), FLAG_MTU); - buf.append("
                                    ").append(_("TX")).append("
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by packets sent"), FLAG_SEND); - buf.append("
                                    ").append(_("RX")).append("
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by packets received"), FLAG_RECV); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by outbound maximum transmit unit"), FLAG_MTU); + buf.append("
                                    ").append(_t("TX")).append("
                                    "); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by packets sent"), FLAG_SEND); + buf.append("
                                    ").append(_t("RX")).append("
                                    "); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by packets received"), FLAG_RECV); buf.append("
                                    ").append(_("Dup TX")).append("
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by packets retransmitted"), FLAG_RESEND); - buf.append("
                                    ").append(_("Dup RX")).append("
                                    "); - appendSortLinks(buf, urlBase, sortFlags, _("Sort by packets received more than once"), FLAG_DUP); + buf.append("
                                    ").append(_t("Dup TX")).append("
                                    "); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by packets retransmitted"), FLAG_RESEND); + buf.append("
                                    ").append(_t("Dup RX")).append("
                                    "); + appendSortLinks(buf, urlBase, sortFlags, _t("Sort by packets received more than once"), FLAG_DUP); buf.append("
                                    "); if (peer.isInbound()) - buf.append("\"Inbound\""); + buf.append("\"Inbound\""); else - buf.append("\"Outbound\""); + buf.append("\"Outbound\""); if (peer.getWeRelayToThemAs() > 0) - buf.append("  \"^\""); + buf.append("  \"^\""); if (peer.getTheyRelayToUsAs() > 0) - buf.append("  \"V\""); + buf.append("  \"V\""); boolean appended = false; if (_activeThrottle.isChoked(peer.getRemotePeer())) { - buf.append("
                                    ").append(_("Choked")).append(""); + buf.append("
                                    ").append(_t("Choked")).append(""); appended = true; } int cfs = peer.getConsecutiveFailedSends(); @@ -2550,15 +2550,15 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority if (!appended) buf.append("
                                    "); buf.append(" "); if (cfs == 1) - buf.append(_("1 fail")); + buf.append(_t("1 fail")); else - buf.append(_("{0} fails", cfs)); + buf.append(_t("{0} fails", cfs)); buf.append(""); appended = true; } if (_context.banlist().isBanlisted(peer.getRemotePeer(), STYLE)) { if (!appended) buf.append("
                                    "); - buf.append(" ").append(_("Banned")).append(""); + buf.append(" ").append(_t("Banned")).append(""); appended = true; } //byte[] ip = getIP(peer.getRemotePeer()); @@ -2617,7 +2617,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority buf.append(THINSP).append(peer.getConcurrentSendWindow()); buf.append(THINSP).append(peer.getConsecutiveSendRejections()); if (peer.isBacklogged()) - buf.append(' ').append(_("backlogged")); + buf.append(' ').append(_t("backlogged")); buf.append("
                                    "); @@ -2949,7 +2949,7 @@ public class UDPTransport extends TransportImpl implements TimedWeightedPriority " from: ", new Exception("traceback")); if (old != Status.UNKNOWN) _context.router().eventLog().addEvent(EventLog.REACHABILITY, - "from " + _(old.toStatusString()) + " to " + _(status.toStatusString())); + "from " + _t(old.toStatusString()) + " to " + _t(status.toStatusString())); // Always rebuild when the status changes, even if our address hasn't changed, // as rebuildExternalAddress() calls replaceAddress() which calls CSFI.notifyReplaceAddress() // which will start up NTCP inbound when we transition to OK.