forked from I2P_Developers/i2p.i2p
Rename _() for translation to _t() for Java 9 compatibility (ticket #1456)
This commit is contained in:
@@ -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
|
||||
|
@@ -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.
|
||||
|
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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() {
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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.
|
||||
*/
|
||||
|
@@ -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<String> 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<List<String>> 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<Long> 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("</a>");
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -826,7 +826,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr ""
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -817,7 +817,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr ""
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -826,7 +826,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Geben Sie einen gültigen Tracker-Namen und die URLs ein"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -808,7 +808,7 @@ msgstr ""
|
||||
msgid "Enter valid tracker name and URLs"
|
||||
msgstr ""
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\" value=\"").append(_("Cancel")).append("\">\n" +
|
||||
#. "<input type=\"reset\" class=\"cancel\" 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"
|
||||
|
@@ -824,7 +824,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Introduzca nombre y URLs de tracker (rastreador) válidos"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -821,7 +821,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Entrez nom de tracker valide et URLs"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -814,7 +814,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Adj meg érvényes követő (tracker) nevet és URL címeket"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -818,7 +818,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Inserisci nome e URL validi per il tracker"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -813,7 +813,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Skriv inn valid tracker navn og URLer"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -816,7 +816,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Geef een geldige trackernaam en URLs in"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -823,7 +823,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Podaj prawidłową nazwę trackera i URL"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -822,7 +822,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Insira um nome válido para o tracker e URLs"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -814,7 +814,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr ""
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -817,7 +817,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Introduceți numele tracker valid și URL-uri"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -829,7 +829,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Введите действительное название и URL трекера"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -816,7 +816,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Zadajte platný názov a URL stopovača"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -822,7 +822,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "Ange giltigt namn och adresser för trackern "
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -810,7 +810,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr ""
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -814,7 +814,7 @@ msgid "Enter valid tracker name and URLs"
|
||||
msgstr "请输入有效的 Tracker 名称与链接"
|
||||
|
||||
#. "<input type=\"reset\" class=\"cancel\"
|
||||
#. value=\"").append(_("Cancel")).append("\">\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"
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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(("<p>" + _("This seems to be a bad destination:") + " " + ahelperKey + " " +
|
||||
_("i2paddresshelper cannot help you with a destination like that!") +
|
||||
out.write(("<p>" + _t("This seems to be a bad destination:") + " " + ahelperKey + " " +
|
||||
_t("i2paddresshelper cannot help you with a destination like that!") +
|
||||
"</p>").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 <a href=\"{0}\">here</a>. To visit the conflicting addresshelper destination, click <a href=\"{1}\">here</a>.",
|
||||
out.write(_t("To visit the destination in your host database, click <a href=\"{0}\">here</a>. To visit the conflicting addresshelper destination, click <a href=\"{1}\">here</a>.",
|
||||
trustedURL, conflictURL).getBytes("UTF-8"));
|
||||
out.write("</p></div>".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("<table><tr><td class=\"mediumtags\" align=\"right\">" + _("Host") +
|
||||
out.write("<table><tr><td class=\"mediumtags\" align=\"right\">" + _t("Host") +
|
||||
"</td><td class=\"mediumtags\">" + destination + "</td></tr>\n");
|
||||
try {
|
||||
String b32 = Base32.encode(SHA256Generator.getInstance().calculateHash(Base64.decode(ahelperKey)).getData());
|
||||
out.write("<tr><td class=\"mediumtags\" align=\"right\">" + _("Base 32") + "</td>" +
|
||||
out.write("<tr><td class=\"mediumtags\" align=\"right\">" + _t("Base 32") + "</td>" +
|
||||
"<td><a href=\"http://" + b32 + ".b32.i2p/\">" + b32 + ".b32.i2p</a></td></tr>");
|
||||
} catch(Exception e) {
|
||||
}
|
||||
out.write("<tr><td class=\"mediumtags\" align=\"right\">" + _("Destination") + "</td><td>" +
|
||||
out.write("<tr><td class=\"mediumtags\" align=\"right\">" + _t("Destination") + "</td><td>" +
|
||||
"<textarea rows=\"1\" style=\"height: 4em; min-width: 0; min-height: 0;\" cols=\"70\" wrap=\"off\" readonly=\"readonly\" >" +
|
||||
ahelperKey + "</textarea></td></tr></table>\n" +
|
||||
"<hr><div class=\"formaction\">" +
|
||||
// FIXME if there is a query remaining it is lost
|
||||
"<form method=\"GET\" action=\"" + targetRequest + "\">" +
|
||||
"<button type=\"submit\" class=\"go\">" + _("Continue to {0} without saving", destination) + "</button>" +
|
||||
"<button type=\"submit\" class=\"go\">" + _t("Continue to {0} without saving", destination) + "</button>" +
|
||||
"</form>\n<form method=\"GET\" action=\"http://" + LOCAL_SERVER + "/add\">" +
|
||||
"<input type=\"hidden\" name=\"host\" value=\"" + destination + "\">\n" +
|
||||
"<input type=\"hidden\" name=\"dest\" value=\"" + ahelperKey + "\">\n" +
|
||||
"<input type=\"hidden\" name=\"nonce\" value=\"" + _proxyNonce + "\">\n" +
|
||||
"<button type=\"submit\" class=\"accept\" name=\"router\" value=\"router\">" +
|
||||
_("Save {0} to router address book and continue to website", destination) + "</button><br>\n");
|
||||
_t("Save {0} to router address book and continue to website", destination) + "</button><br>\n");
|
||||
if(_context.namingService().getName().equals("BlockfileNamingService")) {
|
||||
// only blockfile supports multiple books
|
||||
out.write("<br><button type=\"submit\" name=\"master\" value=\"master\">" + _("Save {0} to master address book and continue to website", destination) + "</button><br>\n");
|
||||
out.write("<button type=\"submit\" name=\"private\" value=\"private\">" + _("Save {0} to private address book and continue to website", destination) + "</button>\n");
|
||||
out.write("<br><button type=\"submit\" name=\"master\" value=\"master\">" + _t("Save {0} to master address book and continue to website", destination) + "</button><br>\n");
|
||||
out.write("<button type=\"submit\" name=\"private\" value=\"private\">" + _t("Save {0} to private address book and continue to website", destination) + "</button>\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.
|
||||
|
@@ -684,7 +684,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
|
||||
out.write("</a>");
|
||||
if (usingWWWProxy) {
|
||||
out.write("<br><br><b>");
|
||||
out.write(_("HTTP Outproxy"));
|
||||
out.write(_t("HTTP Outproxy"));
|
||||
out.write(":</b> " + wwwProxy);
|
||||
}
|
||||
if (extraMessage != null) {
|
||||
@@ -723,7 +723,7 @@ public abstract class I2PTunnelHTTPClientBase extends I2PTunnelClientBase implem
|
||||
if (first) {
|
||||
first = false;
|
||||
out.write("<br><br><h3>");
|
||||
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("</h3>\n");
|
||||
} else {
|
||||
out.write("<br>");
|
||||
@@ -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("</a>\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);
|
||||
}
|
||||
}
|
||||
|
@@ -166,9 +166,9 @@ public abstract class LocalHTTPServer {
|
||||
nsOptions.setProperty("list", book);
|
||||
if (referer != null && referer.startsWith("http")) {
|
||||
String from = "<a href=\"" + referer + "\">" + referer + "</a>";
|
||||
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"+
|
||||
"<html><head>"+
|
||||
"<title>" + _("Redirecting to {0}", host) + "</title>\n" +
|
||||
"<title>" + _t("Redirecting to {0}", host) + "</title>\n" +
|
||||
"<link rel=\"shortcut icon\" href=\"http://proxy.i2p/themes/console/images/favicon.ico\" >\n" +
|
||||
"<link href=\"http://proxy.i2p/themes/console/default/console.css\" rel=\"stylesheet\" type=\"text/css\" >\n" +
|
||||
"<meta http-equiv=\"Refresh\" content=\"1; url=" + url + "\">\n" +
|
||||
"</head><body>\n" +
|
||||
"<div class=logo>\n" +
|
||||
"<a href=\"http://127.0.0.1:7657/\" title=\"" + _("Router Console") + "\"><img src=\"http://proxy.i2p/themes/console/images/i2plogo.png\" alt=\"I2P Router Console\" border=\"0\"></a><hr>\n" +
|
||||
"<a href=\"http://127.0.0.1:7657/config\">" + _("Configuration") + "</a> <a href=\"http://127.0.0.1:7657/help.jsp\">" + _("Help") + "</a> <a href=\"http://127.0.0.1:7657/susidns/index\">" + _("Addressbook") + "</a>\n" +
|
||||
"<a href=\"http://127.0.0.1:7657/\" title=\"" + _t("Router Console") + "\"><img src=\"http://proxy.i2p/themes/console/images/i2plogo.png\" alt=\"I2P Router Console\" border=\"0\"></a><hr>\n" +
|
||||
"<a href=\"http://127.0.0.1:7657/config\">" + _t("Configuration") + "</a> <a href=\"http://127.0.0.1:7657/help.jsp\">" + _t("Help") + "</a> <a href=\"http://127.0.0.1:7657/susidns/index\">" + _t("Addressbook") + "</a>\n" +
|
||||
"</div>" +
|
||||
"<div class=warning id=warning>\n" +
|
||||
"<h3>" +
|
||||
(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)) +
|
||||
"</h3>\n<p><a href=\"" + url + "\">" +
|
||||
_("Click here if you are not redirected automatically.") +
|
||||
_t("Click here if you are not redirected automatically.") +
|
||||
"</a></p></div>").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);
|
||||
}
|
||||
|
||||
|
@@ -146,11 +146,11 @@ public class GeneralHelper {
|
||||
List<String> 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);
|
||||
}
|
||||
}
|
||||
|
@@ -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("</option>\n");
|
||||
|
@@ -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 "<font color=\"red\">" + _("Port not set") + "</font>";
|
||||
return "<font color=\"red\">" + _t("Port not set") + "</font>";
|
||||
int iport = Addresses.getPort(port);
|
||||
if (iport == 0)
|
||||
return "<font color=\"red\">" + _("Invalid port") + ' ' + port + "</font>";
|
||||
return "<font color=\"red\">" + _t("Invalid port") + ' ' + port + "</font>";
|
||||
if (iport < 1024)
|
||||
return "<font color=\"red\">" +
|
||||
_("Warning - ports less than 1024 are not recommended") +
|
||||
_t("Warning - ports less than 1024 are not recommended") +
|
||||
": " + port + "</font>";
|
||||
// dup check, O(n**2)
|
||||
List<TunnelController> controllers = _group.getControllers();
|
||||
@@ -357,12 +357,12 @@ public class IndexBean {
|
||||
continue;
|
||||
if (port.equals(controllers.get(i).getListenPort()))
|
||||
return "<font color=\"red\">" +
|
||||
_("Warning - duplicate port") +
|
||||
_t("Warning - duplicate port") +
|
||||
": " + port + "</font>";
|
||||
}
|
||||
return port;
|
||||
}
|
||||
return "<font color=\"red\">" + _("Port not set") + "</font>";
|
||||
return "<font color=\"red\">" + _t("Port not set") + "</font>";
|
||||
}
|
||||
|
||||
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 = "<font color=\"red\">" + _("Host not set") + "</font>";
|
||||
host = "<font color=\"red\">" + _t("Host not set") + "</font>";
|
||||
else if (Addresses.getIP(host) == null)
|
||||
host = "<font color=\"red\">" + _("Invalid address") + ' ' + host + "</font>";
|
||||
host = "<font color=\"red\">" + _t("Invalid address") + ' ' + host + "</font>";
|
||||
else if (host.indexOf(':') >= 0)
|
||||
host = '[' + host + ']';
|
||||
if (port == null || port.length() == 0)
|
||||
port = "<font color=\"red\">" + _("Port not set") + "</font>";
|
||||
port = "<font color=\"red\">" + _t("Port not set") + "</font>";
|
||||
else if (Addresses.getPort(port) == 0)
|
||||
port = "<font color=\"red\">" + _("Invalid port") + ' ' + port + "</font>";
|
||||
port = "<font color=\"red\">" + _t("Invalid port") + ' ' + port + "</font>";
|
||||
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)
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -16,7 +16,7 @@
|
||||
%>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><%=intl._("Hidden Services Manager")%> - <%=intl._("Edit Client Tunnel")%></title>
|
||||
<title><%=intl._t("Hidden Services Manager")%> - <%=intl._t("Edit Client Tunnel")%></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
|
||||
<link href="/themes/console/images/favicon.ico" type="image/x-icon" rel="shortcut icon" />
|
||||
@@ -49,11 +49,11 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
if (curTunnel >= 0) {
|
||||
tunnelTypeName = editBean.getTunnelType(curTunnel);
|
||||
tunnelType = editBean.getInternalType(curTunnel);
|
||||
%><h4><%=intl._("Edit proxy settings")%></h4><%
|
||||
%><h4><%=intl._t("Edit proxy settings")%></h4><%
|
||||
} else {
|
||||
tunnelTypeName = editBean.getTypeName(request.getParameter("type"));
|
||||
tunnelType = net.i2p.data.DataHelper.stripHTML(request.getParameter("type"));
|
||||
%><h4><%=intl._("New proxy settings")%></h4><%
|
||||
%><h4><%=intl._t("New proxy settings")%></h4><%
|
||||
} %>
|
||||
<input type="hidden" name="tunnel" value="<%=curTunnel%>" />
|
||||
<input type="hidden" name="nonce" value="<%=editBean.getNextNonce()%>" />
|
||||
@@ -87,17 +87,17 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="nameField" class="rowItem">
|
||||
<label for="name" accesskey="N">
|
||||
<%=intl._("Name")%>:(<span class="accessKey">N</span>)
|
||||
<%=intl._t("Name")%>:(<span class="accessKey">N</span>)
|
||||
</label>
|
||||
<input type="text" size="30" maxlength="50" name="name" id="name" title="Tunnel Name" value="<%=editBean.getTunnelName(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="typeField" class="rowItem">
|
||||
<label><%=intl._("Type")%>:</label>
|
||||
<label><%=intl._t("Type")%>:</label>
|
||||
<span class="text"><%=tunnelTypeName%></span>
|
||||
</div>
|
||||
<div id="descriptionField" class="rowItem">
|
||||
<label for="description" accesskey="e">
|
||||
<%=intl._("Description")%>:(<span class="accessKey">E</span>)
|
||||
<%=intl._t("Description")%>:(<span class="accessKey">E</span>)
|
||||
</label>
|
||||
<input type="text" size="60" maxlength="80" name="nofilter_description" id="description" title="Tunnel Description" value="<%=editBean.getTunnelDescription(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
@@ -108,9 +108,9 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="accessField" class="rowItem">
|
||||
<% if ("streamrclient".equals(tunnelType)) { %>
|
||||
<label><%=intl._("Target")%>:</label>
|
||||
<label><%=intl._t("Target")%>:</label>
|
||||
<% } else { %>
|
||||
<label><%=intl._("Access Point")%>:</label>
|
||||
<label><%=intl._t("Access Point")%>:</label>
|
||||
<% } /* streamrclient */ %>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
@@ -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(" <font color=\"red\">(");
|
||||
out.write(intl._("required"));
|
||||
out.write(intl._t("required"));
|
||||
out.write(")</font>");
|
||||
}
|
||||
%>
|
||||
@@ -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(" <font color=\"red\">(");
|
||||
out.write(intl._("required"));
|
||||
out.write(intl._t("required"));
|
||||
out.write(")</font>");
|
||||
}
|
||||
%>
|
||||
</label>
|
||||
<input type="text" size="20" id="targetHost" name="targetHost" title="Target Hostname or IP" value="<%=targetHost%>" class="freetext" />
|
||||
<% } else { %>
|
||||
<%=intl._("Reachable by")%>(<span class="accessKey">R</span>):
|
||||
<%=intl._t("Reachable by")%>(<span class="accessKey">R</span>):
|
||||
</label>
|
||||
<select id="reachableBy" name="reachableBy" title="IP for Client Access" class="selectbox">
|
||||
<%
|
||||
@@ -163,7 +163,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if ("client".equals(tunnelType) || "ircclient".equals(tunnelType)) {
|
||||
%><div id="portField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Use SSL?")%>
|
||||
<%=intl._t("Use SSL?")%>
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="useSSL" title="Clients use SSL to connect" <%=(editBean.isSSLEnabled(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
@@ -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)) {
|
||||
%><div id="destinationField" class="rowItem">
|
||||
<label for="proxyList" accesskey="x">
|
||||
<%=intl._("Outproxies")%>(<span class="accessKey">x</span>):
|
||||
<%=intl._t("Outproxies")%>(<span class="accessKey">x</span>):
|
||||
</label>
|
||||
<input type="text" size="30" id="proxyList" name="proxyList" title="List of Outproxy I2P destinations" value="<%=editBean.getClientDestination(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<% if ("httpclient".equals(tunnelType)) {
|
||||
%><div id="destinationField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("SSL Outproxies")%>:
|
||||
<%=intl._t("SSL Outproxies")%>:
|
||||
</label>
|
||||
<input type="text" size="30" id="sslProxyList" name="sslProxies" title="List of Outproxy I2P destinations" value="<%=editBean.getSslProxies(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<% } // httpclient %>
|
||||
<div id="startupField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Use Outproxy Plugin")%>:
|
||||
<%=intl._t("Use Outproxy Plugin")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="shared" name="useOutproxyPlugin" title="Use plugin instead of above-listed proxies if available"<%=(editBean.getUseOutproxyPlugin(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment"><%=intl._("(Check the Box for 'YES')")%></span>
|
||||
<span class="comment"><%=intl._t("(Check the Box for 'YES')")%></span>
|
||||
</div>
|
||||
<% } else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) {
|
||||
%><div id="destinationField" class="rowItem">
|
||||
<label for="targetDestination" accesskey="T">
|
||||
<%=intl._("Tunnel Destination")%>(<span class="accessKey">T</span>):
|
||||
<%=intl._t("Tunnel Destination")%>(<span class="accessKey">T</span>):
|
||||
<% String value2 = editBean.getClientDestination(curTunnel);
|
||||
if (value2 == null || "".equals(value2.trim())) {
|
||||
out.write(" <font color=\"red\">(");
|
||||
out.write(intl._("required"));
|
||||
out.write(intl._t("required"));
|
||||
out.write(")</font>");
|
||||
}
|
||||
%>
|
||||
</label>
|
||||
<input type="text" size="30" id="targetDestination" name="targetDestination" title="Destination of the Tunnel" value="<%=editBean.getClientDestination(curTunnel)%>" class="freetext" />
|
||||
<span class="comment">(<%=intl._("name, name:port, or destination")%>
|
||||
<span class="comment">(<%=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")%>
|
||||
<% } %> )
|
||||
</span>
|
||||
</div>
|
||||
@@ -218,26 +218,26 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if (!"streamrclient".equals(tunnelType)) { %>
|
||||
<div id="sharedtField" class="rowItem">
|
||||
<label for="shared" accesskey="h">
|
||||
<%=intl._("Shared Client")%>(<span class="accessKey">h</span>):
|
||||
<%=intl._t("Shared Client")%>(<span class="accessKey">h</span>):
|
||||
</label>
|
||||
<input value="true" type="checkbox" id="shared" name="shared" title="Share tunnels with other clients"<%=(editBean.isSharedClient(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment"><%=intl._("(Share tunnels with other clients and irc/httpclients? Change requires restart of client proxy)")%></span>
|
||||
<span class="comment"><%=intl._t("(Share tunnels with other clients and irc/httpclients? Change requires restart of client proxy)")%></span>
|
||||
</div>
|
||||
<% } // !streamrclient %>
|
||||
<div id="startupField" class="rowItem">
|
||||
<label for="startOnLoad" accesskey="a">
|
||||
<%=intl._("Auto Start")%>(<span class="accessKey">A</span>):
|
||||
<%=intl._t("Auto Start")%>(<span class="accessKey">A</span>):
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="startOnLoad" title="Start Tunnel Automatically"<%=(editBean.startAutomatically(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment"><%=intl._("(Check the Box for 'YES')")%></span>
|
||||
<span class="comment"><%=intl._t("(Check the Box for 'YES')")%></span>
|
||||
</div>
|
||||
<% if ("ircclient".equals(tunnelType)) { %>
|
||||
<div id="startupField" class="rowItem">
|
||||
<label for="dcc" accesskey="d">
|
||||
<%=intl._("Enable DCC")%>:
|
||||
<%=intl._t("Enable DCC")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="DCC" title="Enable DCC"<%=(editBean.getDCC(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment"><%=intl._("(Check the Box for 'YES')")%></span>
|
||||
<span class="comment"><%=intl._t("(Check the Box for 'YES')")%></span>
|
||||
</div>
|
||||
<% } // ircclient %>
|
||||
|
||||
@@ -247,8 +247,8 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="tunnelAdvancedNetworking" class="panel">
|
||||
<div class="header">
|
||||
<h4><%=intl._("Advanced networking options")%></h4><br />
|
||||
<span class="comment"><%=intl._("(NOTE: when this client proxy is configured to share tunnels, then these options are for all the shared proxy clients!)")%></span>
|
||||
<h4><%=intl._t("Advanced networking options")%></h4><br />
|
||||
<span class="comment"><%=intl._t("(NOTE: when this client proxy is configured to share tunnels, then these options are for all the shared proxy clients!)")%></span>
|
||||
</div>
|
||||
|
||||
<div class="separator">
|
||||
@@ -256,42 +256,42 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
</div>
|
||||
|
||||
<div id="tunnelOptionsField" class="rowItem">
|
||||
<label><%=intl._("Tunnel Options")%>:</label>
|
||||
<label><%=intl._t("Tunnel Options")%>:</label>
|
||||
</div>
|
||||
<div id="depthField" class="rowItem">
|
||||
<label for="tunnelDepth" accesskey="t">
|
||||
<%=intl._("Length")%>(<span class="accessKey">t</span>):
|
||||
<%=intl._t("Length")%>(<span class="accessKey">t</span>):
|
||||
</label>
|
||||
<select id="tunnelDepth" name="tunnelDepth" title="Length of each Tunnel" class="selectbox">
|
||||
<% int tunnelDepth = editBean.getTunnelDepth(curTunnel, 3);
|
||||
%><option value="0"<%=(tunnelDepth == 0 ? " selected=\"selected\"" : "") %>><%=intl._("0 hop tunnel (no anonymity)")%></option>
|
||||
<option value="1"<%=(tunnelDepth == 1 ? " selected=\"selected\"" : "") %>><%=intl._("1 hop tunnel (low anonymity)")%></option>
|
||||
<option value="2"<%=(tunnelDepth == 2 ? " selected=\"selected\"" : "") %>><%=intl._("2 hop tunnel (medium anonymity)")%></option>
|
||||
<option value="3"<%=(tunnelDepth == 3 ? " selected=\"selected\"" : "") %>><%=intl._("3 hop tunnel (high anonymity)")%></option>
|
||||
%><option value="0"<%=(tunnelDepth == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop tunnel (no anonymity)")%></option>
|
||||
<option value="1"<%=(tunnelDepth == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("1 hop tunnel (low anonymity)")%></option>
|
||||
<option value="2"<%=(tunnelDepth == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("2 hop tunnel (medium anonymity)")%></option>
|
||||
<option value="3"<%=(tunnelDepth == 3 ? " selected=\"selected\"" : "") %>><%=intl._t("3 hop tunnel (high anonymity)")%></option>
|
||||
<% if (tunnelDepth > 3) {
|
||||
%> <option value="<%=tunnelDepth%>" selected="selected"><%=tunnelDepth%> <%=intl._("hop tunnel (very poor performance)")%></option>
|
||||
%> <option value="<%=tunnelDepth%>" selected="selected"><%=tunnelDepth%> <%=intl._t("hop tunnel (very poor performance)")%></option>
|
||||
<% }
|
||||
%></select>
|
||||
</div>
|
||||
<div id="varianceField" class="rowItem">
|
||||
<label for="tunnelVariance" accesskey="v">
|
||||
<%=intl._("Variance")%>(<span class="accessKey">V</span>):
|
||||
<%=intl._t("Variance")%>(<span class="accessKey">V</span>):
|
||||
</label>
|
||||
<select id="tunnelVariance" name="tunnelVariance" title="Level of Randomization for Tunnel Length" class="selectbox">
|
||||
<% int tunnelVariance = editBean.getTunnelVariance(curTunnel, 0);
|
||||
%><option value="0"<%=(tunnelVariance == 0 ? " selected=\"selected\"" : "") %>><%=intl._("0 hop variance (no randomisation, consistant performance)")%></option>
|
||||
<option value="1"<%=(tunnelVariance == 1 ? " selected=\"selected\"" : "") %>><%=intl._("+ 0-1 hop variance (medium additive randomisation, subtractive performance)")%></option>
|
||||
<option value="2"<%=(tunnelVariance == 2 ? " selected=\"selected\"" : "") %>><%=intl._("+ 0-2 hop variance (high additive randomisation, subtractive performance)")%></option>
|
||||
<option value="-1"<%=(tunnelVariance == -1 ? " selected=\"selected\"" : "") %>><%=intl._("+/- 0-1 hop variance (standard randomisation, standard performance)")%></option>
|
||||
<option value="-2"<%=(tunnelVariance == -2 ? " selected=\"selected\"" : "") %>><%=intl._("+/- 0-2 hop variance (not recommended)")%></option>
|
||||
%><option value="0"<%=(tunnelVariance == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop variance (no randomisation, consistant performance)")%></option>
|
||||
<option value="1"<%=(tunnelVariance == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("+ 0-1 hop variance (medium additive randomisation, subtractive performance)")%></option>
|
||||
<option value="2"<%=(tunnelVariance == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("+ 0-2 hop variance (high additive randomisation, subtractive performance)")%></option>
|
||||
<option value="-1"<%=(tunnelVariance == -1 ? " selected=\"selected\"" : "") %>><%=intl._t("+/- 0-1 hop variance (standard randomisation, standard performance)")%></option>
|
||||
<option value="-2"<%=(tunnelVariance == -2 ? " selected=\"selected\"" : "") %>><%=intl._t("+/- 0-2 hop variance (not recommended)")%></option>
|
||||
<% if (tunnelVariance > 2 || tunnelVariance < -2) {
|
||||
%> <option value="<%=tunnelVariance%>" selected="selected"><%= (tunnelVariance > 2 ? "+ " : "+/- ") %>0-<%=tunnelVariance%> <%=intl._("hop variance")%></option>
|
||||
%> <option value="<%=tunnelVariance%>" selected="selected"><%= (tunnelVariance > 2 ? "+ " : "+/- ") %>0-<%=tunnelVariance%> <%=intl._t("hop variance")%></option>
|
||||
<% }
|
||||
%></select>
|
||||
</div>
|
||||
<div id="countField" class="rowItem">
|
||||
<label for="tunnelQuantity" accesskey="C">
|
||||
<%=intl._("Count")%>(<span class="accessKey">C</span>):
|
||||
<%=intl._t("Count")%>(<span class="accessKey">C</span>):
|
||||
</label>
|
||||
<select id="tunnelQuantity" name="tunnelQuantity" title="Number of Tunnels in Group" class="selectbox">
|
||||
<%=editBean.getQuantityOptions(curTunnel)%>
|
||||
@@ -299,16 +299,16 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
</div>
|
||||
<div id="backupField" class="rowItem">
|
||||
<label for="tunnelBackupQuantity" accesskey="b">
|
||||
<%=intl._("Backup Count")%>(<span class="accessKey">B</span>):
|
||||
<%=intl._t("Backup Count")%>(<span class="accessKey">B</span>):
|
||||
</label>
|
||||
<select id="tunnelBackupQuantity" name="tunnelBackupQuantity" title="Number of Reserve Tunnels" class="selectbox">
|
||||
<% int tunnelBackupQuantity = editBean.getTunnelBackupQuantity(curTunnel, 0);
|
||||
%><option value="0"<%=(tunnelBackupQuantity == 0 ? " selected=\"selected\"" : "") %>><%=intl._("0 backup tunnels (0 redundancy, no added resource usage)")%></option>
|
||||
<option value="1"<%=(tunnelBackupQuantity == 1 ? " selected=\"selected\"" : "") %>><%=intl._("1 backup tunnel each direction (low redundancy, low resource usage)")%></option>
|
||||
<option value="2"<%=(tunnelBackupQuantity == 2 ? " selected=\"selected\"" : "") %>><%=intl._("2 backup tunnels each direction (medium redundancy, medium resource usage)")%></option>
|
||||
<option value="3"<%=(tunnelBackupQuantity == 3 ? " selected=\"selected\"" : "") %>><%=intl._("3 backup tunnels each direction (high redundancy, high resource usage)")%></option>
|
||||
%><option value="0"<%=(tunnelBackupQuantity == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 backup tunnels (0 redundancy, no added resource usage)")%></option>
|
||||
<option value="1"<%=(tunnelBackupQuantity == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("1 backup tunnel each direction (low redundancy, low resource usage)")%></option>
|
||||
<option value="2"<%=(tunnelBackupQuantity == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("2 backup tunnels each direction (medium redundancy, medium resource usage)")%></option>
|
||||
<option value="3"<%=(tunnelBackupQuantity == 3 ? " selected=\"selected\"" : "") %>><%=intl._t("3 backup tunnels each direction (high redundancy, high resource usage)")%></option>
|
||||
<% if (tunnelBackupQuantity > 3) {
|
||||
%> <option value="<%=tunnelBackupQuantity%>" selected="selected"><%=tunnelBackupQuantity%> <%=intl._("backup tunnels")%></option>
|
||||
%> <option value="<%=tunnelBackupQuantity%>" selected="selected"><%=tunnelBackupQuantity%> <%=intl._t("backup tunnels")%></option>
|
||||
<% }
|
||||
%></select>
|
||||
</div>
|
||||
@@ -320,20 +320,20 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if (!"streamrclient".equals(tunnelType)) { %>
|
||||
<div id="profileField" class="rowItem">
|
||||
<label for="profile" accesskey="f">
|
||||
<%=intl._("Profile")%>(<span class="accessKey">f</span>):
|
||||
<%=intl._t("Profile")%>(<span class="accessKey">f</span>):
|
||||
</label>
|
||||
<select id="profile" name="profile" title="Connection Profile" class="selectbox">
|
||||
<% boolean interactiveProfile = editBean.isInteractive(curTunnel);
|
||||
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._("interactive connection")%> </option>
|
||||
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._("bulk connection (downloads/websites/BT)")%> </option>
|
||||
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._t("interactive connection")%> </option>
|
||||
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._t("bulk connection (downloads/websites/BT)")%> </option>
|
||||
</select>
|
||||
</div>
|
||||
<div id="delayConnectField" class="rowItem">
|
||||
<label for="connectDelay" accesskey="y">
|
||||
<%=intl._("Delay Connect")%>(<span class="accessKey">y</span>):
|
||||
<%=intl._t("Delay Connect")%>(<span class="accessKey">y</span>):
|
||||
</label>
|
||||
<input value="1000" type="checkbox" id="connectDelay" name="connectDelay" title="Delay Connection"<%=(editBean.shouldDelay(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment">(<%=intl._("for request/response connections")%>)</span>
|
||||
<span class="comment">(<%=intl._t("for request/response connections")%>)</span>
|
||||
</div>
|
||||
|
||||
<div class="subdivider">
|
||||
@@ -342,17 +342,17 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% } // !streamrclient %>
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Router I2CP Address")%>:</label>
|
||||
<label><%=intl._t("Router I2CP Address")%>:</label>
|
||||
</div>
|
||||
<div id="optionsHostField" class="rowItem">
|
||||
<label for="clientHost" accesskey="o">
|
||||
<%=intl._("Host")%>(<span class="accessKey">o</span>):
|
||||
<%=intl._t("Host")%>(<span class="accessKey">o</span>):
|
||||
</label>
|
||||
<input type="text" id="clientHost" name="clientHost" size="20" title="I2CP Hostname or IP" value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />
|
||||
</div>
|
||||
<div id="optionsPortField" class="rowItem">
|
||||
<label for="clientPort" accesskey="r">
|
||||
<%=intl._("Port")%>(<span class="accessKey">r</span>):
|
||||
<%=intl._t("Port")%>(<span class="accessKey">r</span>):
|
||||
</label>
|
||||
<input type="text" id="clientPort" name="clientport" size="20" title="I2CP Port Number" value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />
|
||||
</div>
|
||||
@@ -364,12 +364,12 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label for="reduce" accesskey="c">
|
||||
<%=intl._("Delay tunnel open until required")%>(<span class="accessKey">D</span>):
|
||||
<%=intl._t("Delay tunnel open until required")%>(<span class="accessKey">D</span>):
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="access" accesskey="c">
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="delayOpen" title="Delay Tunnel Open"<%=(editBean.getDelayOpen(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
@@ -381,24 +381,24 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label for="reduce" accesskey="d">
|
||||
<%=intl._("Reduce tunnel quantity when idle")%>(<span class="accessKey">d</span>):
|
||||
<%=intl._t("Reduce tunnel quantity when idle")%>(<span class="accessKey">d</span>):
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="access" accesskey="d">
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="reduce" title="Reduce Tunnels"<%=(editBean.getReduce(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="reduceCount" accesskey="d">
|
||||
<%=intl._("Reduced tunnel count")%>:
|
||||
<%=intl._t("Reduced tunnel count")%>:
|
||||
</label>
|
||||
<input type="text" id="port" name="reduceCount" size="1" maxlength="1" title="Reduced Tunnel Count" value="<%=editBean.getReduceCount(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="reduceTime" accesskey="d">
|
||||
<%=intl._("Idle minutes")%>:
|
||||
<%=intl._t("Idle minutes")%>:
|
||||
</label>
|
||||
<input type="text" id="port" name="reduceTime" size="4" maxlength="4" title="Reduced Tunnel Idle Time" value="<%=editBean.getReduceTime(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
@@ -409,31 +409,31 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label for="reduce" accesskey="c">
|
||||
<%=intl._("Close tunnels when idle")%>(<span class="accessKey">C</span>):
|
||||
<%=intl._t("Close tunnels when idle")%>(<span class="accessKey">C</span>):
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="access" accesskey="c">
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="close" title="Close Tunnels"<%=(editBean.getClose(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="access" accesskey="c">
|
||||
<%=intl._("New Keys on Reopen")%>:
|
||||
<%=intl._t("New Keys on Reopen")%>:
|
||||
</label>
|
||||
<table border="0"><tr><!-- I give up -->
|
||||
<td><input value="1" type="radio" id="startOnLoad" name="newDest" title="New Destination"
|
||||
<%=(editBean.getNewDest(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" /></td>
|
||||
<td><%=intl._("Enable")%></td>
|
||||
<td><%=intl._t("Enable")%></td>
|
||||
<td><input value="0" type="radio" id="startOnLoad" name="newDest" title="New Destination"
|
||||
<%=(editBean.getNewDest(curTunnel) || editBean.getPersistentClientKey(curTunnel) ? "" : " checked=\"checked\"")%> class="tickbox" /></td>
|
||||
<td><%=intl._("Disable")%></td></tr>
|
||||
<td><%=intl._t("Disable")%></td></tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="reduceTime" accesskey="c">
|
||||
<%=intl._("Idle minutes")%>:
|
||||
<%=intl._t("Idle minutes")%>:
|
||||
</label>
|
||||
<input type="text" id="port" name="closeTime" size="4" maxlength="4" title="Close Tunnel Idle Time" value="<%=editBean.getCloseTime(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
@@ -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)) { %>
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label for="privKeyFile" accesskey="k">
|
||||
<%=intl._("Persistent private key")%>(<span class="accessKey">k</span>):
|
||||
<%=intl._t("Persistent private key")%>(<span class="accessKey">k</span>):
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Enable")%>:</label>
|
||||
<label><%=intl._t("Enable")%>:</label>
|
||||
<input value="2" type="radio" id="startOnLoad" name="newDest" title="New Destination"
|
||||
<%=(editBean.getPersistentClientKey(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="reachField" class="rowItem">
|
||||
<label><%=intl._("File")%>:</label>
|
||||
<label><%=intl._t("File")%>:</label>
|
||||
<input type="text" size="30" id="clientHost" name="privKeyFile" title="Path to Private Key File" value="<%=editBean.getPrivateKeyFile(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<%
|
||||
@@ -462,12 +462,12 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
if (destb64.length() > 0) {
|
||||
%> <div id="destinationField" class="rowItem">
|
||||
<label for="localDestination" accesskey="L">
|
||||
<%=intl._("Local destination")%>(<span class="accessKey">L</span>):
|
||||
<%=intl._t("Local destination")%>(<span class="accessKey">L</span>):
|
||||
</label>
|
||||
<textarea rows="1" style="height: 3em;" cols="60" readonly="readonly" id="localDestination" title="Read Only: Local Destination (if known)" wrap="off" spellcheck="false"><%=destb64%></textarea>
|
||||
</div>
|
||||
<div id="destinationField" class="rowItem">
|
||||
<label><%=intl._("Local Base 32")%>:</label>
|
||||
<label><%=intl._t("Local Base 32")%>:</label>
|
||||
<%=editBean.getDestHashBase32(curTunnel)%>
|
||||
</div>
|
||||
<% } // if destb64 %>
|
||||
@@ -479,31 +479,31 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<% if ("httpclient".equals(tunnelType)) { %>
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Pass User-Agent header through")%>:</label>
|
||||
<label><%=intl._t("Pass User-Agent header through")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Enable")%>:</label>
|
||||
<label><%=intl._t("Enable")%>:</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="allowUserAgent" title="Do not spoof user agent string when checked"<%=(editBean.getAllowUserAgent(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div><br />
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Pass Referer header through")%>:</label>
|
||||
<label><%=intl._t("Pass Referer header through")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Enable")%>:</label>
|
||||
<label><%=intl._t("Enable")%>:</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="allowReferer" title="Do not block referer header when checked"<%=(editBean.getAllowReferer(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div><br />
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Pass Accept headers through")%>:</label>
|
||||
<label><%=intl._t("Pass Accept headers through")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Enable")%>:</label>
|
||||
<label><%=intl._t("Enable")%>:</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="allowAccept" title="Do not block accept headers when checked"<%=(editBean.getAllowAccept(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div><br />
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Allow SSL to I2P addresses")%>:</label>
|
||||
<label><%=intl._t("Allow SSL to I2P addresses")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Enable")%>:</label>
|
||||
<label><%=intl._t("Enable")%>:</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="allowInternalSSL" title="Allow SSL to I2P addresses when checked"<%=(editBean.getAllowInternalSSL(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div class="subdivider">
|
||||
@@ -516,8 +516,8 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
%>
|
||||
<div id="tunnelOptionsField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Signature type")%>
|
||||
(<%=intl._("Experts only!")%>)
|
||||
<%=intl._t("Signature type")%>
|
||||
(<%=intl._t("Experts only!")%>)
|
||||
</label>
|
||||
</div>
|
||||
<div id="hostField" class="rowItem">
|
||||
@@ -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)) { %>
|
||||
<div id="accessField" class="rowItem">
|
||||
<label><%=intl._("Local Authorization")%>:</label>
|
||||
<label><%=intl._t("Local Authorization")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="proxyAuth" title="Check to require authorization for this service"<%=(editBean.getProxyAuth(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Username")%>:
|
||||
<%=intl._t("Username")%>:
|
||||
</label>
|
||||
<input type="text" id="clientPort" name="proxyUsername" title="Set username for this service" value="" class="freetext" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Password")%>:
|
||||
<%=intl._t("Password")%>:
|
||||
</label>
|
||||
<input type="password" id="clientPort" name="nofilter_proxyPassword" title="Set password for this service" value="" class="freetext" />
|
||||
</div>
|
||||
@@ -582,23 +582,23 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<hr />
|
||||
</div>
|
||||
<div id="accessField" class="rowItem">
|
||||
<label><%=intl._("Outproxy Authorization")%>:</label>
|
||||
<label><%=intl._t("Outproxy Authorization")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="outproxyAuth" title="Check if the outproxy requires authorization"<%=(editBean.getOutproxyAuth(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Username")%>:
|
||||
<%=intl._t("Username")%>:
|
||||
</label>
|
||||
<input type="text" id="clientPort" name="outproxyUsername" title="Enter username required by outproxy" value="<%=editBean.getOutproxyUsername(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Password")%>:
|
||||
<%=intl._t("Password")%>:
|
||||
</label>
|
||||
<input type="password" id="clientPort" name="nofilter_outproxyPassword" title="Enter password required by outproxy" value="<%=editBean.getOutproxyPassword(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
@@ -609,7 +609,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<% if ("httpclient".equals(tunnelType)) { %>
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Jump URL List")%>:</label>
|
||||
<label><%=intl._t("Jump URL List")%>:</label>
|
||||
</div>
|
||||
<div id="hostField" class="rowItem">
|
||||
<textarea rows="2" style="height: 8em;" cols="60" id="hostField" name="jumpList" title="List of helper URLs to offer when a host is not found in your addressbook" wrap="off" spellcheck="false"><%=editBean.getJumpList(curTunnel)%></textarea>
|
||||
@@ -621,7 +621,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="customOptionsField" class="rowItem">
|
||||
<label for="customOptions" accesskey="u">
|
||||
<%=intl._("Custom options")%>(<span class="accessKey">u</span>):
|
||||
<%=intl._t("Custom options")%>(<span class="accessKey">u</span>):
|
||||
</label>
|
||||
<input type="text" id="customOptions" name="nofilter_customOptions" size="60" title="Custom Options" value="<%=editBean.getCustomOptions(curTunnel)%>" class="freetext" spellcheck="false"/>
|
||||
</div>
|
||||
@@ -634,9 +634,9 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<div class="footer">
|
||||
<div class="toolbox">
|
||||
<input type="hidden" value="true" name="removeConfirm" />
|
||||
<button id="controlCancel" class="control" type="submit" name="action" value="" title="Cancel"><%=intl._("Cancel")%></button>
|
||||
<button id="controlDelete" <%=(editBean.allowJS() ? "onclick=\"if (!confirm('Are you sure you want to delete?')) { return false; }\" " : "")%>accesskey="D" class="control" type="submit" name="action" value="Delete this proxy" title="Delete this Proxy"><%=intl._("Delete")%>(<span class="accessKey">D</span>)</button>
|
||||
<button id="controlSave" accesskey="S" class="control" type="submit" name="action" value="Save changes" title="Save Changes"><%=intl._("Save")%>(<span class="accessKey">S</span>)</button>
|
||||
<button id="controlCancel" class="control" type="submit" name="action" value="" title="Cancel"><%=intl._t("Cancel")%></button>
|
||||
<button id="controlDelete" <%=(editBean.allowJS() ? "onclick=\"if (!confirm('Are you sure you want to delete?')) { return false; }\" " : "")%>accesskey="D" class="control" type="submit" name="action" value="Delete this proxy" title="Delete this Proxy"><%=intl._t("Delete")%>(<span class="accessKey">D</span>)</button>
|
||||
<button id="controlSave" accesskey="S" class="control" type="submit" name="action" value="Save changes" title="Save Changes"><%=intl._t("Save")%>(<span class="accessKey">S</span>)</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -16,7 +16,7 @@
|
||||
%>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><%=intl._("Hidden Services Manager")%> - <%=intl._("Edit Hidden Service")%></title>
|
||||
<title><%=intl._t("Hidden Services Manager")%> - <%=intl._t("Edit Hidden Service")%></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
|
||||
<link href="/themes/console/images/favicon.ico" type="image/x-icon" rel="shortcut icon" />
|
||||
@@ -49,11 +49,11 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
if (curTunnel >= 0) {
|
||||
tunnelTypeName = editBean.getTunnelType(curTunnel);
|
||||
tunnelType = editBean.getInternalType(curTunnel);
|
||||
%><h4><%=intl._("Edit server settings")%></h4><%
|
||||
%><h4><%=intl._t("Edit server settings")%></h4><%
|
||||
} else {
|
||||
tunnelTypeName = editBean.getTypeName(request.getParameter("type"));
|
||||
tunnelType = net.i2p.data.DataHelper.stripHTML(request.getParameter("type"));
|
||||
%><h4><%=intl._("New server settings")%></h4><%
|
||||
%><h4><%=intl._t("New server settings")%></h4><%
|
||||
} %>
|
||||
<input type="hidden" name="tunnel" value="<%=curTunnel%>" />
|
||||
<input type="hidden" name="nonce" value="<%=editBean.getNextNonce()%>" />
|
||||
@@ -87,26 +87,26 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="nameField" class="rowItem">
|
||||
<label for="name" accesskey="N">
|
||||
<%=intl._("Name")%>(<span class="accessKey">N</span>):
|
||||
<%=intl._t("Name")%>(<span class="accessKey">N</span>):
|
||||
</label>
|
||||
<input type="text" size="30" maxlength="50" name="name" id="name" title="Tunnel Name" value="<%=editBean.getTunnelName(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="typeField" class="rowItem">
|
||||
<label><%=intl._("Type")%>:</label>
|
||||
<label><%=intl._t("Type")%>:</label>
|
||||
<span class="text"><%=tunnelTypeName%></span>
|
||||
</div>
|
||||
<div id="descriptionField" class="rowItem">
|
||||
<label for="description" accesskey="e">
|
||||
<%=intl._("Description")%>(<span class="accessKey">e</span>):
|
||||
<%=intl._t("Description")%>(<span class="accessKey">e</span>):
|
||||
</label>
|
||||
<input type="text" size="60" maxlength="80" name="nofilter_description" id="description" title="Tunnel Description" value="<%=editBean.getTunnelDescription(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="startupField" class="rowItem">
|
||||
<label for="startOnLoad" accesskey="a">
|
||||
<%=intl._("Auto Start")%>(<span class="accessKey">A</span>):
|
||||
<%=intl._t("Auto Start")%>(<span class="accessKey">A</span>):
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="startOnLoad" title="Start Tunnel Automatically"<%=(editBean.startAutomatically(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment"><%=intl._("(Check the Box for 'YES')")%></span>
|
||||
<span class="comment"><%=intl._t("(Check the Box for 'YES')")%></span>
|
||||
</div>
|
||||
|
||||
<div class="subdivider">
|
||||
@@ -115,26 +115,26 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="targetField" class="rowItem">
|
||||
<% if ("streamrserver".equals(tunnelType)) { %>
|
||||
<label><%=intl._("Access Point")%>:</label>
|
||||
<label><%=intl._t("Access Point")%>:</label>
|
||||
<% } else { %>
|
||||
<label><%=intl._("Target")%>:</label>
|
||||
<label><%=intl._t("Target")%>:</label>
|
||||
<% } %>
|
||||
</div>
|
||||
<% if (!"streamrserver".equals(tunnelType)) { %>
|
||||
<div id="hostField" class="rowItem">
|
||||
<label for="targetHost" accesskey="H">
|
||||
<%=intl._("Host")%>(<span class="accessKey">H</span>):
|
||||
<%=intl._t("Host")%>(<span class="accessKey">H</span>):
|
||||
</label>
|
||||
<input type="text" size="20" id="targetHost" name="targetHost" title="Target Hostname or IP" value="<%=editBean.getTargetHost(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<% } /* !streamrserver */ %>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="targetPort" accesskey="P">
|
||||
<%=intl._("Port")%>(<span class="accessKey">P</span>):
|
||||
<%=intl._t("Port")%>(<span class="accessKey">P</span>):
|
||||
<% String value = editBean.getTargetPort(curTunnel);
|
||||
if (value == null || "".equals(value.trim())) {
|
||||
out.write(" <font color=\"red\">(");
|
||||
out.write(intl._("required"));
|
||||
out.write(intl._t("required"));
|
||||
out.write(")</font>");
|
||||
}
|
||||
%>
|
||||
@@ -144,7 +144,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if (!"streamrserver".equals(tunnelType)) { %>
|
||||
<div id="portField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Use SSL?")%>
|
||||
<%=intl._t("Use SSL?")%>
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="useSSL" title="Use SSL to connect to target" <%=(editBean.isSSLEnabled(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
@@ -155,7 +155,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<hr />
|
||||
</div>
|
||||
<div id="accessField" class="rowItem">
|
||||
<label><%=intl._("Access Point")%>:</label>
|
||||
<label><%=intl._t("Access Point")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="port" accesskey="P">
|
||||
@@ -163,7 +163,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% String value4 = editBean.getClientPort(curTunnel);
|
||||
if (value4 == null || "".equals(value4.trim())) {
|
||||
out.write(" <font color=\"red\">(");
|
||||
out.write(intl._("required"));
|
||||
out.write(intl._t("required"));
|
||||
out.write(")</font>");
|
||||
}
|
||||
%>
|
||||
@@ -174,7 +174,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if ("httpbidirserver".equals(tunnelType) || "streamrserver".equals(tunnelType)) { %>
|
||||
<div id="reachField" class="rowItem">
|
||||
<label for="reachableBy" accesskey="r">
|
||||
<%=intl._("Reachable by")%>(<span class="accessKey">R</span>):
|
||||
<%=intl._t("Reachable by")%>(<span class="accessKey">R</span>):
|
||||
</label>
|
||||
<select id="reachableBy" name="reachableBy" title="IP for Client Access" class="selectbox">
|
||||
<%
|
||||
@@ -201,19 +201,19 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
|
||||
%><div id="websiteField" class="rowItem">
|
||||
<label for="spoofedHost" accesskey="W">
|
||||
<%=intl._("Website name")%>(<span class="accessKey">W</span>):
|
||||
<%=intl._t("Website name")%>(<span class="accessKey">W</span>):
|
||||
</label>
|
||||
<input type="text" size="20" id="targetHost" name="spoofedHost" title="Website Host Name" value="<%=editBean.getSpoofedHost(curTunnel)%>" class="freetext" />
|
||||
<span class="comment"><%=intl._("(leave blank for outproxies)")%></span>
|
||||
<span class="comment"><%=intl._t("(leave blank for outproxies)")%></span>
|
||||
</div>
|
||||
<% }
|
||||
%><div id="privKeyField" class="rowItem">
|
||||
<label for="privKeyFile" accesskey="k">
|
||||
<%=intl._("Private key file")%>(<span class="accessKey">k</span>):
|
||||
<%=intl._t("Private key file")%>(<span class="accessKey">k</span>):
|
||||
<% String value3 = editBean.getPrivateKeyFile(curTunnel);
|
||||
if (value3 == null || "".equals(value3.trim())) {
|
||||
out.write(" <font color=\"red\">(");
|
||||
out.write(intl._("required"));
|
||||
out.write(intl._t("required"));
|
||||
out.write(")</font>");
|
||||
}
|
||||
%>
|
||||
@@ -223,7 +223,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="destinationField" class="rowItem">
|
||||
<label for="localDestination" accesskey="L">
|
||||
<%=intl._("Local destination")%>(<span class="accessKey">L</span>):
|
||||
<%=intl._t("Local destination")%>(<span class="accessKey">L</span>):
|
||||
</label>
|
||||
<textarea rows="1" style="height: 3em;" cols="60" readonly="readonly" id="localDestination" title="Read Only: Local Destination (if known)" wrap="off" spellcheck="false"><%=editBean.getDestinationBase64(curTunnel)%></textarea>
|
||||
<% String b64 = editBean.getDestinationBase64(curTunnel);
|
||||
@@ -232,7 +232,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
if (name == null || name.equals(""))
|
||||
name = editBean.getTunnelName(curTunnel);
|
||||
if (!"".equals(name)) { %>
|
||||
<a href="/susidns/addressbook.jsp?book=private&hostname=<%=name%>&destination=<%=b64%>#add"><%=intl._("Add to local addressbook")%></a>
|
||||
<a href="/susidns/addressbook.jsp?book=private&hostname=<%=name%>&destination=<%=b64%>#add"><%=intl._t("Add to local addressbook")%></a>
|
||||
<% }
|
||||
} %>
|
||||
</div>
|
||||
@@ -240,7 +240,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
|
||||
%><div id="sigField" class="rowItem">
|
||||
<label for="signature">
|
||||
<%=intl._("Hostname Signature")%>
|
||||
<%=intl._t("Hostname Signature")%>
|
||||
</label>
|
||||
<input type="text" size="30" readonly="readonly" title="Use to prove that the website name is for this destination" value="<%=editBean.getNameSignature(curTunnel)%>" wrap="off" class="freetext" />
|
||||
</div>
|
||||
@@ -252,7 +252,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="tunnelAdvancedNetworking" class="panel">
|
||||
<div class="header">
|
||||
<h4><%=intl._("Advanced networking options")%></h4>
|
||||
<h4><%=intl._t("Advanced networking options")%></h4>
|
||||
</div>
|
||||
|
||||
<div class="separator">
|
||||
@@ -260,42 +260,42 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
</div>
|
||||
|
||||
<div id="tunnelOptionsField" class="rowItem">
|
||||
<label><%=intl._("Tunnel Options")%>:</label>
|
||||
<label><%=intl._t("Tunnel Options")%>:</label>
|
||||
</div>
|
||||
<div id="depthField" class="rowItem">
|
||||
<label for="tunnelDepth" accesskey="t">
|
||||
<%=intl._("Length")%>(<span class="accessKey">t</span>):
|
||||
<%=intl._t("Length")%>(<span class="accessKey">t</span>):
|
||||
</label>
|
||||
<select id="tunnelDepth" name="tunnelDepth" title="Length of each Tunnel" class="selectbox">
|
||||
<% int tunnelDepth = editBean.getTunnelDepth(curTunnel, 3);
|
||||
%><option value="0"<%=(tunnelDepth == 0 ? " selected=\"selected\"" : "") %>><%=intl._("0 hop tunnel (no anonymity)")%></option>
|
||||
<option value="1"<%=(tunnelDepth == 1 ? " selected=\"selected\"" : "") %>><%=intl._("1 hop tunnel (low anonymity)")%></option>
|
||||
<option value="2"<%=(tunnelDepth == 2 ? " selected=\"selected\"" : "") %>><%=intl._("2 hop tunnel (medium anonymity)")%></option>
|
||||
<option value="3"<%=(tunnelDepth == 3 ? " selected=\"selected\"" : "") %>><%=intl._("3 hop tunnel (high anonymity)")%></option>
|
||||
%><option value="0"<%=(tunnelDepth == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop tunnel (no anonymity)")%></option>
|
||||
<option value="1"<%=(tunnelDepth == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("1 hop tunnel (low anonymity)")%></option>
|
||||
<option value="2"<%=(tunnelDepth == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("2 hop tunnel (medium anonymity)")%></option>
|
||||
<option value="3"<%=(tunnelDepth == 3 ? " selected=\"selected\"" : "") %>><%=intl._t("3 hop tunnel (high anonymity)")%></option>
|
||||
<% if (tunnelDepth > 3) {
|
||||
%> <option value="<%=tunnelDepth%>" selected="selected"><%=tunnelDepth%> <%=intl._("hop tunnel (very poor performance)")%></option>
|
||||
%> <option value="<%=tunnelDepth%>" selected="selected"><%=tunnelDepth%> <%=intl._t("hop tunnel (very poor performance)")%></option>
|
||||
<% }
|
||||
%></select>
|
||||
</div>
|
||||
<div id="varianceField" class="rowItem">
|
||||
<label for="tunnelVariance" accesskey="v">
|
||||
<%=intl._("Variance")%>(<span class="accessKey">V</span>):
|
||||
<%=intl._t("Variance")%>(<span class="accessKey">V</span>):
|
||||
</label>
|
||||
<select id="tunnelVariance" name="tunnelVariance" title="Level of Randomization for Tunnel Depth" class="selectbox">
|
||||
<% int tunnelVariance = editBean.getTunnelVariance(curTunnel, 0);
|
||||
%><option value="0"<%=(tunnelVariance == 0 ? " selected=\"selected\"" : "") %>><%=intl._("0 hop variance (no randomisation, consistant performance)")%></option>
|
||||
<option value="1"<%=(tunnelVariance == 1 ? " selected=\"selected\"" : "") %>><%=intl._("+ 0-1 hop variance (medium additive randomisation, subtractive performance)")%></option>
|
||||
<option value="2"<%=(tunnelVariance == 2 ? " selected=\"selected\"" : "") %>><%=intl._("+ 0-2 hop variance (high additive randomisation, subtractive performance)")%></option>
|
||||
<option value="-1"<%=(tunnelVariance == -1 ? " selected=\"selected\"" : "") %>><%=intl._("+/- 0-1 hop variance (standard randomisation, standard performance)")%></option>
|
||||
<option value="-2"<%=(tunnelVariance == -2 ? " selected=\"selected\"" : "") %>><%=intl._("+/- 0-2 hop variance (not recommended)")%></option>
|
||||
%><option value="0"<%=(tunnelVariance == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 hop variance (no randomisation, consistant performance)")%></option>
|
||||
<option value="1"<%=(tunnelVariance == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("+ 0-1 hop variance (medium additive randomisation, subtractive performance)")%></option>
|
||||
<option value="2"<%=(tunnelVariance == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("+ 0-2 hop variance (high additive randomisation, subtractive performance)")%></option>
|
||||
<option value="-1"<%=(tunnelVariance == -1 ? " selected=\"selected\"" : "") %>><%=intl._t("+/- 0-1 hop variance (standard randomisation, standard performance)")%></option>
|
||||
<option value="-2"<%=(tunnelVariance == -2 ? " selected=\"selected\"" : "") %>><%=intl._t("+/- 0-2 hop variance (not recommended)")%></option>
|
||||
<% if (tunnelVariance > 2 || tunnelVariance < -2) {
|
||||
%> <option value="<%=tunnelVariance%>" selected="selected"><%= (tunnelVariance > 2 ? "+ " : "+/- ") %>0-<%=tunnelVariance%> <%=intl._("hop variance")%></option>
|
||||
%> <option value="<%=tunnelVariance%>" selected="selected"><%= (tunnelVariance > 2 ? "+ " : "+/- ") %>0-<%=tunnelVariance%> <%=intl._t("hop variance")%></option>
|
||||
<% }
|
||||
%></select>
|
||||
</div>
|
||||
<div id="countField" class="rowItem">
|
||||
<label for="tunnelQuantity" accesskey="C">
|
||||
<%=intl._("Count")%>(<span class="accessKey">C</span>):
|
||||
<%=intl._t("Count")%>(<span class="accessKey">C</span>):
|
||||
</label>
|
||||
<select id="tunnelQuantity" name="tunnelQuantity" title="Number of Tunnels in Group" class="selectbox">
|
||||
<%=editBean.getQuantityOptions(curTunnel)%>
|
||||
@@ -303,16 +303,16 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
</div>
|
||||
<div id="backupField" class="rowItem">
|
||||
<label for="tunnelBackupQuantity" accesskey="b">
|
||||
<%=intl._("Backup Count")%>(<span class="accessKey">B</span>):
|
||||
<%=intl._t("Backup Count")%>(<span class="accessKey">B</span>):
|
||||
</label>
|
||||
<select id="tunnelBackupQuantity" name="tunnelBackupQuantity" title="Number of Reserve Tunnels" class="selectbox">
|
||||
<% int tunnelBackupQuantity = editBean.getTunnelBackupQuantity(curTunnel, 0);
|
||||
%><option value="0"<%=(tunnelBackupQuantity == 0 ? " selected=\"selected\"" : "") %>><%=intl._("0 backup tunnels (0 redundancy, no added resource usage)")%></option>
|
||||
<option value="1"<%=(tunnelBackupQuantity == 1 ? " selected=\"selected\"" : "") %>><%=intl._("1 backup tunnel each direction (low redundancy, low resource usage)")%></option>
|
||||
<option value="2"<%=(tunnelBackupQuantity == 2 ? " selected=\"selected\"" : "") %>><%=intl._("2 backup tunnels each direction (medium redundancy, medium resource usage)")%></option>
|
||||
<option value="3"<%=(tunnelBackupQuantity == 3 ? " selected=\"selected\"" : "") %>><%=intl._("3 backup tunnels each direction (high redundancy, high resource usage)")%></option>
|
||||
%><option value="0"<%=(tunnelBackupQuantity == 0 ? " selected=\"selected\"" : "") %>><%=intl._t("0 backup tunnels (0 redundancy, no added resource usage)")%></option>
|
||||
<option value="1"<%=(tunnelBackupQuantity == 1 ? " selected=\"selected\"" : "") %>><%=intl._t("1 backup tunnel each direction (low redundancy, low resource usage)")%></option>
|
||||
<option value="2"<%=(tunnelBackupQuantity == 2 ? " selected=\"selected\"" : "") %>><%=intl._t("2 backup tunnels each direction (medium redundancy, medium resource usage)")%></option>
|
||||
<option value="3"<%=(tunnelBackupQuantity == 3 ? " selected=\"selected\"" : "") %>><%=intl._t("3 backup tunnels each direction (high redundancy, high resource usage)")%></option>
|
||||
<% if (tunnelBackupQuantity > 3) {
|
||||
%> <option value="<%=tunnelBackupQuantity%>" selected="selected"><%=tunnelBackupQuantity%> <%=intl._("backup tunnels")%></option>
|
||||
%> <option value="<%=tunnelBackupQuantity%>" selected="selected"><%=tunnelBackupQuantity%> <%=intl._t("backup tunnels")%></option>
|
||||
<% }
|
||||
%></select>
|
||||
</div>
|
||||
@@ -324,12 +324,12 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if (!"streamrserver".equals(tunnelType)) { %>
|
||||
<div id="profileField" class="rowItem">
|
||||
<label for="profile" accesskey="f">
|
||||
<%=intl._("Profile")%>(<span class="accessKey">f</span>):
|
||||
<%=intl._t("Profile")%>(<span class="accessKey">f</span>):
|
||||
</label>
|
||||
<select id="profile" name="profile" title="Connection Profile" class="selectbox">
|
||||
<% boolean interactiveProfile = editBean.isInteractive(curTunnel);
|
||||
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._("interactive connection")%> </option>
|
||||
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._("bulk connection (downloads/websites/BT)")%> </option>
|
||||
%><option <%=(interactiveProfile == true ? "selected=\"selected\" " : "")%>value="interactive"><%=intl._t("interactive connection")%> </option>
|
||||
<option <%=(interactiveProfile == false ? "selected=\"selected\" " : "")%>value="bulk"><%=intl._t("bulk connection (downloads/websites/BT)")%> </option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -339,17 +339,17 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% } /* !streamrserver */ %>
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Router I2CP Address")%>:</label>
|
||||
<label><%=intl._t("Router I2CP Address")%>:</label>
|
||||
</div>
|
||||
<div id="optionsHostField" class="rowItem">
|
||||
<label for="clientHost" accesskey="o">
|
||||
<%=intl._("Host")%>(<span class="accessKey">o</span>):
|
||||
<%=intl._t("Host")%>(<span class="accessKey">o</span>):
|
||||
</label>
|
||||
<input type="text" id="clientHost" name="clientHost" size="20" title="I2CP Hostname or IP" value="<%=editBean.getI2CPHost(curTunnel)%>" class="freetext" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />
|
||||
</div>
|
||||
<div id="optionsPortField" class="rowItem">
|
||||
<label for="clientPort" accesskey="r">
|
||||
<%=intl._("Port")%>(<span class="accessKey">r</span>):
|
||||
<%=intl._t("Port")%>(<span class="accessKey">r</span>):
|
||||
</label>
|
||||
<input type="text" id="clientPort" name="clientport" size="20" title="I2CP Port Number" value="<%=editBean.getI2CPPort(curTunnel)%>" class="freetext" <% if (editBean.isRouterContext()) { %> readonly="readonly" <% } %> />
|
||||
</div>
|
||||
@@ -360,27 +360,27 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label for="encrypt" accesskey="e">
|
||||
<%=intl._("Encrypt Leaseset")%>(<span class="accessKey">E</span>):
|
||||
<%=intl._t("Encrypt Leaseset")%>(<span class="accessKey">E</span>):
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="encrypt" accesskey="e">
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="encrypt" title="ONLY clients with the encryption key will be able to connect"<%=(editBean.getEncrypt(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="encrypt" accesskey="e">
|
||||
<%=intl._("Encryption Key")%>:
|
||||
<%=intl._t("Encryption Key")%>:
|
||||
</label>
|
||||
<textarea rows="1" style="height: 3em;" cols="44" id="portField" name="encryptKey" title="Encrypt Key" wrap="off" spellcheck="false"><%=editBean.getEncryptKey(curTunnel)%></textarea>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="force" accesskey="c">
|
||||
<%=intl._("Generate New Key")%>:
|
||||
<%=intl._t("Generate New Key")%>:
|
||||
</label>
|
||||
<button accesskey="S" class="control" type="submit" name="action" value="Generate" title="Generate New Key Now"><%=intl._("Generate")%></button>
|
||||
<span class="comment"><%=intl._("(Tunnel must be stopped first)")%></span>
|
||||
<button accesskey="S" class="control" type="submit" name="action" value="Generate" title="Generate New Key Now"><%=intl._t("Generate")%></button>
|
||||
<span class="comment"><%=intl._t("(Tunnel must be stopped first)")%></span>
|
||||
</div>
|
||||
|
||||
<div class="subdivider">
|
||||
@@ -389,20 +389,20 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label for="access" accesskey="s">
|
||||
<%=intl._("Restricted Access List")%>(<span class="accessKey">s</span>):
|
||||
<%=intl._t("Restricted Access List")%>(<span class="accessKey">s</span>):
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Disable")%></label>
|
||||
<label><%=intl._t("Disable")%></label>
|
||||
<input value="0" type="radio" id="startOnLoad" name="accessMode" title="Allow all clients"<%=(editBean.getAccessMode(curTunnel).equals("0") ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<label><%=intl._("Whitelist")%></label>
|
||||
<label><%=intl._t("Whitelist")%></label>
|
||||
<input value="1" type="radio" id="startOnLoad" name="accessMode" title="Allow listed clients only"<%=(editBean.getAccessMode(curTunnel).equals("1") ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<label><%=intl._("Blacklist")%></label>
|
||||
<label><%=intl._t("Blacklist")%></label>
|
||||
<input value="2" type="radio" id="startOnLoad" name="accessMode" title="Reject listed clients"<%=(editBean.getAccessMode(curTunnel).equals("2") ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="hostField" class="rowItem">
|
||||
<label for="accessList" accesskey="s">
|
||||
<%=intl._("Access List")%>:
|
||||
<%=intl._t("Access List")%>:
|
||||
</label>
|
||||
<textarea rows="2" style="height: 8em;" cols="60" id="hostField" name="accessList" title="Access List" wrap="off" spellcheck="false"><%=editBean.getAccessList(curTunnel)%></textarea>
|
||||
</div>
|
||||
@@ -411,12 +411,12 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
%><div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Block Access via Inproxies")%>:
|
||||
<%=intl._t("Block Access via Inproxies")%>:
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="access" accesskey="d">
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="rejectInproxy" title="Deny inproxy access when enabled"<%=(editBean.isRejectInproxy(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
@@ -425,12 +425,12 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
%><div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Unique Local Address per Client")%>:
|
||||
<%=intl._t("Unique Local Address per Client")%>:
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="access" accesskey="d">
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="uniqueLocal" title="Use unique IP addresses for each connecting client (local non-SSL servers only)"<%=(editBean.getUniqueLocal(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
@@ -438,12 +438,12 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Optimize for Multihoming")%>:
|
||||
<%=intl._t("Optimize for Multihoming")%>:
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="access" accesskey="d">
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="multihome" title="Only enable if you are hosting this service on multiple routers"<%=(editBean.getMultihome(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
@@ -454,24 +454,24 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Inbound connection limits (0=unlimited)")%><br /><%=intl._("Per client")%>:</label>
|
||||
<label><%=intl._t("Inbound connection limits (0=unlimited)")%><br /><%=intl._t("Per client")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Per minute")%>:</label>
|
||||
<label><%=intl._t("Per minute")%>:</label>
|
||||
<input type="text" id="port" name="limitMinute" value="<%=editBean.getLimitMinute(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Per hour")%>:</label>
|
||||
<label><%=intl._t("Per hour")%>:</label>
|
||||
<input type="text" id="port" name="limitHour" value="<%=editBean.getLimitHour(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Per day")%>:</label>
|
||||
<label><%=intl._t("Per day")%>:</label>
|
||||
<input type="text" id="port" name="limitDay" value="<%=editBean.getLimitDay(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Total")%>:</label>
|
||||
<label><%=intl._t("Total")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<input type="text" id="port" name="totalMinute" value="<%=editBean.getTotalMinute(curTunnel)%>" class="freetext" />
|
||||
@@ -485,7 +485,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
</div>
|
||||
<div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Max concurrent connections (0=unlimited)")%>:</label>
|
||||
<label><%=intl._t("Max concurrent connections (0=unlimited)")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<input type="text" id="port" name="maxStreams" value="<%=editBean.getMaxStreams(curTunnel)%>" class="freetext" />
|
||||
@@ -495,20 +495,20 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% if (("httpserver".equals(tunnelType)) || ("httpbidirserver".equals(tunnelType))) {
|
||||
%><div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("POST limits (0=unlimited)")%><br /><%=intl._("Per client")%>:</label>
|
||||
<label><%=intl._t("POST limits (0=unlimited)")%><br /><%=intl._t("Per client")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Per period")%>:</label>
|
||||
<label><%=intl._t("Per period")%>:</label>
|
||||
<input type="text" id="port" name="postMax" value="<%=editBean.getPostMax(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Ban minutes")%>:</label>
|
||||
<label><%=intl._t("Ban minutes")%>:</label>
|
||||
<input type="text" id="port" name="postBanTime" value="<%=editBean.getPostBanTime(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("Total")%>:</label>
|
||||
<label><%=intl._t("Total")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<input type="text" id="port" name="postTotalMax" value="<%=editBean.getPostTotalMax(curTunnel)%>" class="freetext" />
|
||||
@@ -519,7 +519,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
</div>
|
||||
<div class="rowItem">
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label><%=intl._("POST limit period (minutes)")%>:</label>
|
||||
<label><%=intl._t("POST limit period (minutes)")%>:</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<input type="text" id="port" name="postCheckTime" value="<%=editBean.getPostCheckTime(curTunnel)%>" class="freetext" />
|
||||
@@ -532,24 +532,24 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="optionsField" class="rowItem">
|
||||
<label for="reduce" accesskey="d">
|
||||
<%=intl._("Reduce tunnel quantity when idle")%>(<span class="accessKey">d</span>):
|
||||
<%=intl._t("Reduce tunnel quantity when idle")%>(<span class="accessKey">d</span>):
|
||||
</label>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="access" accesskey="d">
|
||||
<%=intl._("Enable")%>:
|
||||
<%=intl._t("Enable")%>:
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="reduce" title="Reduce Tunnels"<%=(editBean.getReduce(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="reduceCount" accesskey="d">
|
||||
<%=intl._("Reduced tunnel count")%>:
|
||||
<%=intl._t("Reduced tunnel count")%>:
|
||||
</label>
|
||||
<input type="text" id="port" name="reduceCount" size="1" maxlength="1" title="Reduced Tunnel Count" value="<%=editBean.getReduceCount(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="reduceTime" accesskey="d">
|
||||
<%=intl._("Idle minutes")%>:
|
||||
<%=intl._t("Idle minutes")%>:
|
||||
</label>
|
||||
<input type="text" id="port" name="reduceTime" size="4" maxlength="4" title="Reduced Tunnel Idle Time" value="<%=editBean.getReduceTime(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
@@ -561,34 +561,34 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<% /***************** %>
|
||||
<div id="tunnelOptionsField" class="rowItem">
|
||||
<label for="cert" accesskey="c">
|
||||
<%=intl._("New Certificate type")%>(<span class="accessKey">C</span>):
|
||||
<%=intl._t("New Certificate type")%>(<span class="accessKey">C</span>):
|
||||
</label>
|
||||
</div>
|
||||
<div id="hostField" class="rowItem">
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("None")%></label>
|
||||
<label><%=intl._t("None")%></label>
|
||||
<input value="0" type="radio" id="startOnLoad" name="cert" title="No Certificate"<%=(editBean.getCert(curTunnel)==0 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Hashcash (effort)")%></label>
|
||||
<label><%=intl._t("Hashcash (effort)")%></label>
|
||||
<input value="1" type="radio" id="startOnLoad" name="cert" title="Hashcash Certificate"<%=(editBean.getCert(curTunnel)==1 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<input type="text" id="port" name="effort" size="2" maxlength="2" title="Hashcash Effort" value="<%=editBean.getEffort(curTunnel)%>" class="freetext" />
|
||||
</div>
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="force" accesskey="c">
|
||||
<%=intl._("Hashcash Calc Time")%>:
|
||||
<%=intl._t("Hashcash Calc Time")%>:
|
||||
</label>
|
||||
<button accesskey="S" class="control" type="submit" name="action" value="Estimate" title="Estimate Calculation Time"><%=intl._("Estimate")%></button>
|
||||
<button accesskey="S" class="control" type="submit" name="action" value="Estimate" title="Estimate Calculation Time"><%=intl._t("Estimate")%></button>
|
||||
</div>
|
||||
<div id="hostField" class="rowItem">
|
||||
<div id="portField" class="rowItem">
|
||||
<label><%=intl._("Hidden")%></label>
|
||||
<label><%=intl._t("Hidden")%></label>
|
||||
<input value="2" type="radio" id="startOnLoad" name="cert" title="Hidden Certificate"<%=(editBean.getCert(curTunnel)==2 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="signer" accesskey="c">
|
||||
<%=intl._("Signed (signed by)")%>:
|
||||
<%=intl._t("Signed (signed by)")%>:
|
||||
</label>
|
||||
<input value="3" type="radio" id="startOnLoad" name="cert" title="Signed Certificate"<%=(editBean.getCert(curTunnel)==3 ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<input type="text" id="port" name="signer" size="50" title="Cert Signer" value="<%=editBean.getSigner(curTunnel)%>" class="freetext" />
|
||||
@@ -596,10 +596,10 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
</div>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="force" accesskey="c">
|
||||
<%=intl._("Modify Certificate")%>:
|
||||
<%=intl._t("Modify Certificate")%>:
|
||||
</label>
|
||||
<button accesskey="S" class="control" type="submit" name="action" value="Modify" title="Force New Cert Now"><%=intl._("Modify")%></button>
|
||||
<span class="comment"><%=intl._("(Tunnel must be stopped first)")%></span>
|
||||
<button accesskey="S" class="control" type="submit" name="action" value="Modify" title="Force New Cert Now"><%=intl._t("Modify")%></button>
|
||||
<span class="comment"><%=intl._t("(Tunnel must be stopped first)")%></span>
|
||||
</div>
|
||||
<% **********************/ %>
|
||||
|
||||
@@ -608,8 +608,8 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
%>
|
||||
<div id="tunnelOptionsField" class="rowItem">
|
||||
<label>
|
||||
<%=intl._("Signature type")%>
|
||||
(<%=intl._("Experts only! Changes B32!")%>)
|
||||
<%=intl._t("Signature type")%>
|
||||
(<%=intl._t("Experts only! Changes B32!")%>)
|
||||
</label>
|
||||
</div>
|
||||
<div id="hostField" class="rowItem">
|
||||
@@ -650,7 +650,7 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
|
||||
<div id="customOptionsField" class="rowItem">
|
||||
<label for="customOptions" accesskey="u">
|
||||
<%=intl._("Custom options")%>(<span class="accessKey">u</span>):
|
||||
<%=intl._t("Custom options")%>(<span class="accessKey">u</span>):
|
||||
</label>
|
||||
<input type="text" id="customOptions" name="nofilter_customOptions" size="60" title="Custom Options" value="<%=editBean.getCustomOptions(curTunnel)%>" class="freetext" spellcheck="false"/>
|
||||
</div>
|
||||
@@ -663,9 +663,9 @@ input.default { width: 1px; height: 1px; visibility: hidden; }
|
||||
<div class="footer">
|
||||
<div class="toolbox">
|
||||
<input type="hidden" value="true" name="removeConfirm" />
|
||||
<button id="controlCancel" class="control" type="submit" name="action" value="" title="Cancel"><%=intl._("Cancel")%></button>
|
||||
<button id="controlDelete" <%=(editBean.allowJS() ? "onclick=\"if (!confirm('Are you sure you want to delete?')) { return false; }\" " : "")%>accesskey="D" class="control" type="submit" name="action" value="Delete this proxy" title="Delete this Proxy"><%=intl._("Delete")%>(<span class="accessKey">D</span>)</button>
|
||||
<button id="controlSave" accesskey="S" class="control" type="submit" name="action" value="Save changes" title="Save Changes"><%=intl._("Save")%>(<span class="accessKey">S</span>)</button>
|
||||
<button id="controlCancel" class="control" type="submit" name="action" value="" title="Cancel"><%=intl._t("Cancel")%></button>
|
||||
<button id="controlDelete" <%=(editBean.allowJS() ? "onclick=\"if (!confirm('Are you sure you want to delete?')) { return false; }\" " : "")%>accesskey="D" class="control" type="submit" name="action" value="Delete this proxy" title="Delete this Proxy"><%=intl._t("Delete")%>(<span class="accessKey">D</span>)</button>
|
||||
<button id="controlSave" accesskey="S" class="control" type="submit" name="action" value="Save changes" title="Save Changes"><%=intl._t("Save")%>(<span class="accessKey">S</span>)</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -19,7 +19,7 @@
|
||||
<jsp:useBean class="net.i2p.i2ptunnel.web.Messages" id="intl" scope="request" />
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><%=intl._("Hidden Services Manager")%></title>
|
||||
<title><%=intl._t("Hidden Services Manager")%></title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
<div id="statusMessagePanel" class="panel">
|
||||
<div class="header">
|
||||
<h4><%=intl._("Status Messages")%></h4>
|
||||
<h4><%=intl._t("Status Messages")%></h4>
|
||||
</div>
|
||||
|
||||
<div class="separator">
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<div class="footer">
|
||||
<div class="toolbox">
|
||||
<a class="control" href="list"><%=intl._("Refresh")%></a>
|
||||
<a class="control" href="list"><%=intl._t("Refresh")%></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,13 +66,13 @@
|
||||
<div class="header"></div>
|
||||
<div class="footer">
|
||||
<div class="toolbox">
|
||||
<a class="control" href="wizard"><%=intl._("Tunnel Wizard")%></a>
|
||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Stop%20all"><%=intl._("Stop All")%></a>
|
||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Start%20all"><%=intl._("Start All")%></a>
|
||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Restart%20all"><%=intl._("Restart All")%></a>
|
||||
<a class="control" href="wizard"><%=intl._t("Tunnel Wizard")%></a>
|
||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Stop%20all"><%=intl._t("Stop All")%></a>
|
||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Start%20all"><%=intl._t("Start All")%></a>
|
||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Restart%20all"><%=intl._t("Restart All")%></a>
|
||||
<%--
|
||||
//this is really bad because it stops and restarts all tunnels, which is probably not what you want
|
||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Reload%20configuration"><%=intl._("Reload Config")%></a>
|
||||
<a class="control" href="list?nonce=<%=indexBean.getNextNonce()%>&action=Reload%20configuration"><%=intl._t("Reload Config")%></a>
|
||||
--%>
|
||||
</div>
|
||||
</div>
|
||||
@@ -83,23 +83,23 @@
|
||||
<div id="localServerTunnelList" class="panel">
|
||||
<div class="header">
|
||||
|
||||
<h4><%=intl._("I2P Hidden Services")%></h4>
|
||||
<h4><%=intl._t("I2P Hidden Services")%></h4>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="separator"> </div>
|
||||
|
||||
<div class="nameHeaderField rowItem">
|
||||
<label><%=intl._("Name")%>:</label>
|
||||
<label><%=intl._t("Name")%>:</label>
|
||||
</div>
|
||||
<div class="previewHeaderField rowItem">
|
||||
<label><%=intl._("Points at")%>:</label>
|
||||
<label><%=intl._t("Points at")%>:</label>
|
||||
</div>
|
||||
<div class="targetHeaderField rowItem">
|
||||
<label><%=intl._("Preview")%>:</label>
|
||||
<label><%=intl._t("Preview")%>:</label>
|
||||
</div>
|
||||
<div class="statusHeaderField rowItem">
|
||||
<label><%=intl._("Status")%>:</label>
|
||||
<label><%=intl._t("Status")%>:</label>
|
||||
<hr /> </div>
|
||||
|
||||
<%
|
||||
@@ -108,11 +108,11 @@
|
||||
|
||||
%>
|
||||
<div class="nameField rowItem">
|
||||
<label><%=intl._("Name")%>:</label>
|
||||
<label><%=intl._t("Name")%>:</label>
|
||||
<span class="text"><a href="edit?tunnel=<%=curServer%>" title="Edit Server Tunnel Settings for <%=indexBean.getTunnelName(curServer)%>"><%=indexBean.getTunnelName(curServer)%></a></span>
|
||||
</div>
|
||||
<div class="previewField rowItem">
|
||||
<label><%=intl._("Points at")%>:</label>
|
||||
<label><%=intl._t("Points at")%>:</label>
|
||||
<span class="text">
|
||||
<%
|
||||
if (indexBean.isServerTargetLinkValid(curServer)) {
|
||||
@@ -135,41 +135,41 @@
|
||||
<div class="targetField rowItem">
|
||||
<%
|
||||
if (("httpserver".equals(indexBean.getInternalType(curServer)) || ("httpbidirserver".equals(indexBean.getInternalType(curServer)))) && indexBean.getTunnelStatus(curServer) == IndexBean.RUNNING) {
|
||||
%><label><%=intl._("Preview")%>:</label>
|
||||
<a class="control" title="Test HTTP server through I2P" href="http://<%=indexBean.getDestHashBase32(curServer)%>" target="_top"><%=intl._("Preview")%></a>
|
||||
%><label><%=intl._t("Preview")%>:</label>
|
||||
<a class="control" title="Test HTTP server through I2P" href="http://<%=indexBean.getDestHashBase32(curServer)%>" target="_top"><%=intl._t("Preview")%></a>
|
||||
<%
|
||||
} else if (indexBean.getTunnelStatus(curServer) == IndexBean.RUNNING) {
|
||||
%><span class="text"><%=intl._("Base32 Address")%>:<br /><%=indexBean.getDestHashBase32(curServer)%></span>
|
||||
%><span class="text"><%=intl._t("Base32 Address")%>:<br /><%=indexBean.getDestHashBase32(curServer)%></span>
|
||||
<%
|
||||
} else {
|
||||
%><span class="comment"><%=intl._("No Preview")%></span>
|
||||
%><span class="comment"><%=intl._t("No Preview")%></span>
|
||||
<%
|
||||
}
|
||||
%></div>
|
||||
<div class="statusField rowItem">
|
||||
<label><%=intl._("Status")%>:</label>
|
||||
<label><%=intl._t("Status")%>:</label>
|
||||
<%
|
||||
switch (indexBean.getTunnelStatus(curServer)) {
|
||||
case IndexBean.STARTING:
|
||||
%><div class="statusStarting text"><%=intl._("Starting...")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curServer%>"><%=intl._("Stop")%></a>
|
||||
%><div class="statusStarting text"><%=intl._t("Starting...")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
|
||||
<%
|
||||
break;
|
||||
case IndexBean.RUNNING:
|
||||
%><div class="statusRunning text"><%=intl._("Running")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curServer%>"><%=intl._("Stop")%></a>
|
||||
%><div class="statusRunning text"><%=intl._t("Running")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curServer%>"><%=intl._t("Stop")%></a>
|
||||
<%
|
||||
break;
|
||||
case IndexBean.NOT_RUNNING:
|
||||
%><div class="statusNotRunning text"><%=intl._("Stopped")%></div>
|
||||
<a class="control" title="Start this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=start&tunnel=<%=curServer%>"><%=intl._("Start")%></a>
|
||||
%><div class="statusNotRunning text"><%=intl._t("Stopped")%></div>
|
||||
<a class="control" title="Start this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=start&tunnel=<%=curServer%>"><%=intl._t("Start")%></a>
|
||||
<%
|
||||
break;
|
||||
}
|
||||
%></div>
|
||||
|
||||
<div class="descriptionField rowItem">
|
||||
<label><%=intl._("Description")%>:</label>
|
||||
<label><%=intl._t("Description")%>:</label>
|
||||
<div class="text"><%=indexBean.getTunnelDescription(curServer)%></div>
|
||||
</div>
|
||||
|
||||
@@ -187,15 +187,15 @@
|
||||
<form id="addNewServerTunnelForm" action="edit">
|
||||
<div class="toolbox">
|
||||
|
||||
<label><%=intl._("New hidden service")%>:</label>
|
||||
<label><%=intl._t("New hidden service")%>:</label>
|
||||
<select name="type">
|
||||
<option value="httpserver">HTTP</option>
|
||||
<option value="server"><%=intl._("Standard")%></option>
|
||||
<option value="server"><%=intl._t("Standard")%></option>
|
||||
<option value="httpbidirserver">HTTP bidir</option>
|
||||
<option value="ircserver">IRC</option>
|
||||
<option value="streamrserver">Streamr</option>
|
||||
</select>
|
||||
<input class="control" type="submit" value="<%=intl._("Create")%>" />
|
||||
<input class="control" type="submit" value="<%=intl._t("Create")%>" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -205,26 +205,26 @@
|
||||
<div id="localClientTunnelList" class="panel">
|
||||
<div class="header">
|
||||
|
||||
<h4><%=intl._("I2P Client Tunnels")%></h4>
|
||||
<h4><%=intl._t("I2P Client Tunnels")%></h4>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="separator"> </div>
|
||||
|
||||
<div class="nameHeaderField rowItem">
|
||||
<label><%=intl._("Name")%>:</label>
|
||||
<label><%=intl._t("Name")%>:</label>
|
||||
</div>
|
||||
<div class="portHeaderField rowItem">
|
||||
<label><%=intl._("Port")%>:</label>
|
||||
<label><%=intl._t("Port")%>:</label>
|
||||
</div>
|
||||
<div class="typeHeaderField rowItem">
|
||||
<label><%=intl._("Type")%>:</label>
|
||||
<label><%=intl._t("Type")%>:</label>
|
||||
</div>
|
||||
<div class="interfaceHeaderField rowItem">
|
||||
<label><%=intl._("Interface")%>:</label>
|
||||
<label><%=intl._t("Interface")%>:</label>
|
||||
</div>
|
||||
<div class="statusHeaderField rowItem">
|
||||
<label><%=intl._("Status")%>:</label>
|
||||
<label><%=intl._t("Status")%>:</label>
|
||||
</div>
|
||||
|
||||
<div class="separator">
|
||||
@@ -235,11 +235,11 @@
|
||||
if (!indexBean.isClient(curClient)) continue;
|
||||
%>
|
||||
<div class="nameField rowItem">
|
||||
<label><%=intl._("Name")%>:</label>
|
||||
<label><%=intl._t("Name")%>:</label>
|
||||
<span class="text"><a href="edit?tunnel=<%=curClient%>" title="Edit Tunnel Settings for <%=indexBean.getTunnelName(curClient)%>"><%=indexBean.getTunnelName(curClient)%></a></span>
|
||||
</div>
|
||||
<div class="portField rowItem">
|
||||
<label><%=intl._("Port")%>:</label>
|
||||
<label><%=intl._t("Port")%>:</label>
|
||||
<span class="text">
|
||||
<%
|
||||
String cPort= indexBean.getClientPort2(curClient);
|
||||
@@ -250,18 +250,18 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="typeField rowItem">
|
||||
<label><%=intl._("Type")%>:</label>
|
||||
<label><%=intl._t("Type")%>:</label>
|
||||
<span class="text"><%=indexBean.getTunnelType(curClient)%></span>
|
||||
</div>
|
||||
<div class="interfaceField rowItem">
|
||||
<label><%=intl._("Interface")%>:</label>
|
||||
<label><%=intl._t("Interface")%>:</label>
|
||||
<span class="text">
|
||||
<%
|
||||
/* should only happen for streamr client */
|
||||
String cHost= indexBean.getClientInterface(curClient);
|
||||
if (cHost == null || "".equals(cHost)) {
|
||||
out.write("<font color=\"red\">");
|
||||
out.write(intl._("Host not set"));
|
||||
out.write(intl._t("Host not set"));
|
||||
out.write("</font>");
|
||||
} else {
|
||||
out.write(cHost);
|
||||
@@ -270,27 +270,27 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="statusField rowItem">
|
||||
<label><%=intl._("Status")%>:</label>
|
||||
<label><%=intl._t("Status")%>:</label>
|
||||
<%
|
||||
switch (indexBean.getTunnelStatus(curClient)) {
|
||||
case IndexBean.STARTING:
|
||||
%><div class="statusStarting text"><%=intl._("Starting...")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._("Stop")%></a>
|
||||
%><div class="statusStarting text"><%=intl._t("Starting...")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
||||
<%
|
||||
break;
|
||||
case IndexBean.STANDBY:
|
||||
%><div class="statusStarting text"><%=intl._("Standby")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._("Stop")%></a>
|
||||
%><div class="statusStarting text"><%=intl._t("Standby")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
||||
<%
|
||||
break;
|
||||
case IndexBean.RUNNING:
|
||||
%><div class="statusRunning text"><%=intl._("Running")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._("Stop")%></a>
|
||||
%><div class="statusRunning text"><%=intl._t("Running")%></div>
|
||||
<a class="control" title="Stop this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=stop&tunnel=<%=curClient%>"><%=intl._t("Stop")%></a>
|
||||
<%
|
||||
break;
|
||||
case IndexBean.NOT_RUNNING:
|
||||
%><div class="statusNotRunning text"><%=intl._("Stopped")%></div>
|
||||
<a class="control" title="Start this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=start&tunnel=<%=curClient%>"><%=intl._("Start")%></a>
|
||||
%><div class="statusNotRunning text"><%=intl._t("Stopped")%></div>
|
||||
<a class="control" title="Start this Tunnel" href="list?nonce=<%=indexBean.getNextNonce()%>&action=start&tunnel=<%=curClient%>"><%=intl._t("Start")%></a>
|
||||
<%
|
||||
break;
|
||||
}
|
||||
@@ -300,15 +300,15 @@
|
||||
<label>
|
||||
<% if ("httpclient".equals(indexBean.getInternalType(curClient)) || "connectclient".equals(indexBean.getInternalType(curClient)) ||
|
||||
"sockstunnel".equals(indexBean.getInternalType(curClient)) || "socksirctunnel".equals(indexBean.getInternalType(curClient))) { %>
|
||||
<%=intl._("Outproxy")%>:
|
||||
<%=intl._t("Outproxy")%>:
|
||||
<% } else { %>
|
||||
<%=intl._("Destination")%>:
|
||||
<%=intl._t("Destination")%>:
|
||||
<% } %>
|
||||
</label>
|
||||
<div class="text">
|
||||
<%
|
||||
if (indexBean.getIsUsingOutproxyPlugin(curClient)) {
|
||||
%><%=intl._("internal plugin")%><%
|
||||
%><%=intl._t("internal plugin")%><%
|
||||
} else {
|
||||
String cdest = indexBean.getClientDestination(curClient);
|
||||
if (cdest.length() > 70) { // Probably a B64 (a B32 is 60 chars) so truncate
|
||||
@@ -316,7 +316,7 @@
|
||||
} else if (cdest.length() > 0) {
|
||||
%><%=cdest%><%
|
||||
} else {
|
||||
%><i><%=intl._("none")%></i><%
|
||||
%><i><%=intl._t("none")%></i><%
|
||||
}
|
||||
} %>
|
||||
</div>
|
||||
@@ -324,7 +324,7 @@
|
||||
<% /* TODO SSL outproxy for httpclient if plugin not present */ %>
|
||||
|
||||
<div class="descriptionField rowItem">
|
||||
<label><%=intl._("Description")%>:</label>
|
||||
<label><%=intl._t("Description")%>:</label>
|
||||
<div class="text"><%=indexBean.getTunnelDescription(curClient)%></div>
|
||||
</div>
|
||||
|
||||
@@ -342,9 +342,9 @@
|
||||
<form id="addNewClientTunnelForm" action="edit">
|
||||
<div class="toolbox">
|
||||
|
||||
<label><%=intl._("New client tunnel")%>:</label>
|
||||
<label><%=intl._t("New client tunnel")%>:</label>
|
||||
<select name="type">
|
||||
<option value="client"><%=intl._("Standard")%></option>
|
||||
<option value="client"><%=intl._t("Standard")%></option>
|
||||
<option value="httpclient">HTTP/CONNECT</option>
|
||||
<option value="ircclient">IRC</option>
|
||||
<option value="sockstunnel">SOCKS 4/4a/5</option>
|
||||
@@ -352,7 +352,7 @@
|
||||
<option value="connectclient">CONNECT</option>
|
||||
<option value="streamrclient">Streamr</option>
|
||||
</select>
|
||||
<input class="control" type="submit" value="<%=intl._("Create")%>" />
|
||||
<input class="control" type="submit" value="<%=intl._t("Create")%>" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@@ -53,7 +53,7 @@
|
||||
%>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title><%=intl._("I2P Tunnel Manager - Tunnel Creation Wizard")%></title>
|
||||
<title><%=intl._t("I2P Tunnel Manager - Tunnel Creation Wizard")%></title>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
|
||||
@@ -76,19 +76,19 @@
|
||||
<div class="header">
|
||||
<%
|
||||
if (curPage == 1) {
|
||||
%><h4><%=intl._("Server or client tunnel?")%></h4><%
|
||||
%><h4><%=intl._t("Server or client tunnel?")%></h4><%
|
||||
} else if (curPage == 2) {
|
||||
%><h4><%=intl._("Tunnel type")%></h4><%
|
||||
%><h4><%=intl._t("Tunnel type")%></h4><%
|
||||
} else if (curPage == 3) {
|
||||
%><h4><%=intl._("Tunnel name and description")%></h4><%
|
||||
%><h4><%=intl._t("Tunnel name and description")%></h4><%
|
||||
} else if (curPage == 4 && tunnelIsClient) {
|
||||
%><h4><%=intl._("Tunnel destination")%></h4><%
|
||||
%><h4><%=intl._t("Tunnel destination")%></h4><%
|
||||
} else if (curPage == 5) {
|
||||
%><h4><%=intl._("Binding address and port")%></h4><%
|
||||
%><h4><%=intl._t("Binding address and port")%></h4><%
|
||||
} else if (curPage == 6) {
|
||||
%><h4><%=intl._("Tunnel auto-start")%></h4><%
|
||||
%><h4><%=intl._t("Tunnel auto-start")%></h4><%
|
||||
} else if (curPage == 7) {
|
||||
%><h4><%=intl._("Wizard completed")%></h4><%
|
||||
%><h4><%=intl._t("Wizard completed")%></h4><%
|
||||
} %>
|
||||
<input type="hidden" name="page" value="<%=curPage%>" />
|
||||
<input type="hidden" name="tunnel" value="null" />
|
||||
@@ -103,17 +103,17 @@
|
||||
|
||||
if (curPage == 1) {
|
||||
%><p>
|
||||
<%=intl._("This wizard will take you through the various options available for creating tunnels in I2P.")%>
|
||||
<%=intl._t("This wizard will take you through the various options available for creating tunnels in I2P.")%>
|
||||
</p>
|
||||
<p>
|
||||
<%=intl._("The first thing to decide is whether you want to create a server or a client tunnel.")%>
|
||||
<%=intl._("If you need to connect to a remote service, such as an IRC server inside I2P or a code repository, then you will require a CLIENT tunnel.")%>
|
||||
<%=intl._("On the other hand, if you wish to host a service for others to connect to you'll need to create a SERVER tunnel.")%>
|
||||
<%=intl._t("The first thing to decide is whether you want to create a server or a client tunnel.")%>
|
||||
<%=intl._t("If you need to connect to a remote service, such as an IRC server inside I2P or a code repository, then you will require a CLIENT tunnel.")%>
|
||||
<%=intl._t("On the other hand, if you wish to host a service for others to connect to you'll need to create a SERVER tunnel.")%>
|
||||
</p>
|
||||
<div id="typeField" class="rowItem">
|
||||
<label><%=intl._("Server Tunnel")%></label>
|
||||
<label><%=intl._t("Server Tunnel")%></label>
|
||||
<input value="false" type="radio" id="baseType" name="isClient" class="tickbox" />
|
||||
<label><%=intl._("Client Tunnel")%></label>
|
||||
<label><%=intl._t("Client Tunnel")%></label>
|
||||
<input value="true" type="radio" id="baseType" name="isClient" class="tickbox" checked="checked" />
|
||||
</div><%
|
||||
} else {
|
||||
@@ -126,64 +126,64 @@
|
||||
|
||||
if (curPage == 2) {
|
||||
%><p>
|
||||
<%=intl._("There are several types of tunnels to choose from:")%>
|
||||
<%=intl._t("There are several types of tunnels to choose from:")%>
|
||||
</p>
|
||||
<table><%
|
||||
if (tunnelIsClient) {
|
||||
%>
|
||||
<tr><td><%=intl._("Standard")%></td><td>
|
||||
<%=intl._("Basic tunnel for connecting to a single service inside I2P.")%>
|
||||
<%=intl._("Try this if none of the tunnel types below fit your requirements, or you don't know what type of tunnel you need.")%>
|
||||
<tr><td><%=intl._t("Standard")%></td><td>
|
||||
<%=intl._t("Basic tunnel for connecting to a single service inside I2P.")%>
|
||||
<%=intl._t("Try this if none of the tunnel types below fit your requirements, or you don't know what type of tunnel you need.")%>
|
||||
</td></tr>
|
||||
<tr><td>HTTP</td><td>
|
||||
<%=intl._("Tunnel that acts as an HTTP proxy for reaching eepsites inside I2P.")%>
|
||||
<%=intl._("Set your browser to use this tunnel as an http proxy, or set your \"http_proxy\" environment variable for command-line applications in GNU/Linux.")%>
|
||||
<%=intl._("Websites outside I2P can also be reached if an HTTP proxy within I2P is known.")%>
|
||||
<%=intl._t("Tunnel that acts as an HTTP proxy for reaching eepsites inside I2P.")%>
|
||||
<%=intl._t("Set your browser to use this tunnel as an http proxy, or set your \"http_proxy\" environment variable for command-line applications in GNU/Linux.")%>
|
||||
<%=intl._t("Websites outside I2P can also be reached if an HTTP proxy within I2P is known.")%>
|
||||
</td></tr>
|
||||
<tr><td>IRC</td><td>
|
||||
<%=intl._("Customised client tunnel specific for IRC connections.")%>
|
||||
<%=intl._("With this tunnel type, your IRC client will be able to connect to an IRC network inside I2P.")%>
|
||||
<%=intl._("Each IRC network in I2P that you wish to connect to will require its own tunnel. (See Also, SOCKS IRC)")%>
|
||||
<%=intl._t("Customised client tunnel specific for IRC connections.")%>
|
||||
<%=intl._t("With this tunnel type, your IRC client will be able to connect to an IRC network inside I2P.")%>
|
||||
<%=intl._t("Each IRC network in I2P that you wish to connect to will require its own tunnel. (See Also, SOCKS IRC)")%>
|
||||
</td></tr>
|
||||
<tr><td>SOCKS 4/4a/5</td><td>
|
||||
<%=intl._("A tunnel that implements the SOCKS protocol.")%>
|
||||
<%=intl._("This enables both TCP and UDP connections to be made through a SOCKS outproxy within I2P.")%>
|
||||
<%=intl._t("A tunnel that implements the SOCKS protocol.")%>
|
||||
<%=intl._t("This enables both TCP and UDP connections to be made through a SOCKS outproxy within I2P.")%>
|
||||
</td></tr>
|
||||
<tr><td>SOCKS IRC</td><td>
|
||||
<%=intl._("A client tunnel implementing the SOCKS protocol, which is customised for connecting to IRC networks.")%>
|
||||
<%=intl._("With this tunnel type, IRC networks in I2P can be reached by typing the I2P address into your IRC client, and configuring the IRC client to use this SOCKS tunnel.")%>
|
||||
<%=intl._("This means that only one I2P tunnel is required rather than a separate tunnel per IRC network.")%>
|
||||
<%=intl._("IRC networks outside I2P can also be reached if a SOCKS outproxy within I2P is known, though it depends on whether or not the outproxy has been blocked by the IRC network.")%>
|
||||
<%=intl._t("A client tunnel implementing the SOCKS protocol, which is customised for connecting to IRC networks.")%>
|
||||
<%=intl._t("With this tunnel type, IRC networks in I2P can be reached by typing the I2P address into your IRC client, and configuring the IRC client to use this SOCKS tunnel.")%>
|
||||
<%=intl._t("This means that only one I2P tunnel is required rather than a separate tunnel per IRC network.")%>
|
||||
<%=intl._t("IRC networks outside I2P can also be reached if a SOCKS outproxy within I2P is known, though it depends on whether or not the outproxy has been blocked by the IRC network.")%>
|
||||
</td></tr>
|
||||
<tr><td>CONNECT</td><td>
|
||||
<%=intl._("A client tunnel that implements the HTTP CONNECT command.")%>
|
||||
<%=intl._("This enables TCP connections to be made through an HTTP outproxy, assuming the proxy supports the CONNECT command.")%>
|
||||
<%=intl._t("A client tunnel that implements the HTTP CONNECT command.")%>
|
||||
<%=intl._t("This enables TCP connections to be made through an HTTP outproxy, assuming the proxy supports the CONNECT command.")%>
|
||||
</td></tr>
|
||||
<tr><td>Streamr</td><td>
|
||||
<%=intl._("A customised client tunnel for Streamr.")%><%
|
||||
//XXX TODO<%=intl._("I have no idea what this is.")%>
|
||||
<%=intl._t("A customised client tunnel for Streamr.")%><%
|
||||
//XXX TODO<%=intl._t("I have no idea what this is.")%>
|
||||
</td></tr><%
|
||||
} else {
|
||||
%>
|
||||
<tr><td><%=intl._("Standard")%></td><td>
|
||||
<%=intl._("A basic server tunnel for hosting a generic service inside I2P.")%>
|
||||
<%=intl._("Try this if none of the tunnel types below fit your requirements, or you don't know what type of tunnel you need.")%>
|
||||
<tr><td><%=intl._t("Standard")%></td><td>
|
||||
<%=intl._t("A basic server tunnel for hosting a generic service inside I2P.")%>
|
||||
<%=intl._t("Try this if none of the tunnel types below fit your requirements, or you don't know what type of tunnel you need.")%>
|
||||
</td></tr>
|
||||
<tr><td>HTTP</td><td>
|
||||
<%=intl._("A server tunnel that is customised for HTTP connections.")%>
|
||||
<%=intl._("Use this tunnel type if you want to host an eepsite.")%>
|
||||
<%=intl._t("A server tunnel that is customised for HTTP connections.")%>
|
||||
<%=intl._t("Use this tunnel type if you want to host an eepsite.")%>
|
||||
</td></tr>
|
||||
<tr><td>HTTP bidir</td><td>
|
||||
<%=intl._("A customised server tunnel that can both serve HTTP data and connect to other server tunnels.")%>
|
||||
<%=intl._("This tunnel type is predominantly used when running a Seedless server.")%>
|
||||
<%=intl._t("A customised server tunnel that can both serve HTTP data and connect to other server tunnels.")%>
|
||||
<%=intl._t("This tunnel type is predominantly used when running a Seedless server.")%>
|
||||
</td></tr>
|
||||
<tr><td>IRC</td><td>
|
||||
<%=intl._("A customised server tunnel for hosting IRC networks inside I2P.")%>
|
||||
<%=intl._("Usually, a separate tunnel needs to be created for each IRC server that is to be accessible inside I2P.")%>
|
||||
<%=intl._t("A customised server tunnel for hosting IRC networks inside I2P.")%>
|
||||
<%=intl._t("Usually, a separate tunnel needs to be created for each IRC server that is to be accessible inside I2P.")%>
|
||||
</td></tr>
|
||||
<tr><td>Streamr</td><td>
|
||||
<%=intl._("A customised server tunnel for Streamr.")%><%
|
||||
//XXX TODO<%=intl._("I have no idea what this is.")%>
|
||||
<%=intl._t("A customised server tunnel for Streamr.")%><%
|
||||
//XXX TODO<%=intl._t("I have no idea what this is.")%>
|
||||
</td></tr><%
|
||||
}
|
||||
%>
|
||||
@@ -192,7 +192,7 @@
|
||||
<%
|
||||
if (tunnelIsClient) {
|
||||
%><select name="type">
|
||||
<option value="client"><%=intl._("Standard")%></option>
|
||||
<option value="client"><%=intl._t("Standard")%></option>
|
||||
<option value="httpclient">HTTP/CONNECT</option>
|
||||
<option value="ircclient">IRC</option>
|
||||
<option value="sockstunnel">SOCKS 4/4a/5</option>
|
||||
@@ -202,7 +202,7 @@
|
||||
</select><%
|
||||
} else {
|
||||
%><select name="type">
|
||||
<option value="server"><%=intl._("Standard")%></option>
|
||||
<option value="server"><%=intl._t("Standard")%></option>
|
||||
<option value="httpserver">HTTP</option>
|
||||
<option value="httpbidirserver">HTTP bidir</option>
|
||||
<option value="ircserver">IRC</option>
|
||||
@@ -220,18 +220,18 @@
|
||||
|
||||
if (curPage == 3) {
|
||||
%><p>
|
||||
<%=intl._("Choose a name and description for your tunnel.")%>
|
||||
<%=intl._("These can be anything you want - they are just for ease of identifying the tunnel in the routerconsole.")%>
|
||||
<%=intl._t("Choose a name and description for your tunnel.")%>
|
||||
<%=intl._t("These can be anything you want - they are just for ease of identifying the tunnel in the routerconsole.")%>
|
||||
</p>
|
||||
<div id="nameField" class="rowItem">
|
||||
<label for="name" accesskey="N">
|
||||
<%=intl._("Name")%>:(<span class="accessKey">N</span>)
|
||||
<%=intl._t("Name")%>:(<span class="accessKey">N</span>)
|
||||
</label>
|
||||
<input type="text" size="30" maxlength="50" name="name" id="name" title="Tunnel Name" value="<%=(!"null".equals(request.getParameter("name")) ? net.i2p.data.DataHelper.stripHTML(request.getParameter("name")) : "" ) %>" class="freetext" />
|
||||
</div>
|
||||
<div id="descriptionField" class="rowItem">
|
||||
<label for="description" accesskey="e">
|
||||
<%=intl._("Description")%>:(<span class="accessKey">E</span>)
|
||||
<%=intl._t("Description")%>:(<span class="accessKey">E</span>)
|
||||
</label>
|
||||
<input type="text" size="60" maxlength="80" name="nofilter_description" id="description" title="Tunnel Description" value="<%=(!"null".equals(request.getParameter("nofilter_description")) ? net.i2p.data.DataHelper.stripHTML(request.getParameter("nofilter_description")) : "" ) %>" class="freetext" />
|
||||
</div><%
|
||||
@@ -248,12 +248,12 @@
|
||||
if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) {
|
||||
if (curPage == 4) {
|
||||
%><p>
|
||||
<%=intl._("If you know of any outproxies for this type of tunnel (either HTTP or SOCKS), fill them in below.")%>
|
||||
<%=intl._("Separate multiple proxies with commas.")%>
|
||||
<%=intl._t("If you know of any outproxies for this type of tunnel (either HTTP or SOCKS), fill them in below.")%>
|
||||
<%=intl._t("Separate multiple proxies with commas.")%>
|
||||
</p>
|
||||
<div id="destinationField" class="rowItem">
|
||||
<label for="proxyList" accesskey="x">
|
||||
<%=intl._("Outproxies")%>(<span class="accessKey">x</span>):
|
||||
<%=intl._t("Outproxies")%>(<span class="accessKey">x</span>):
|
||||
</label>
|
||||
<input type="text" size="30" id="proxyList" name="proxyList" title="List of Outproxy I2P destinations" value="<%=(!"null".equals(request.getParameter("proxyList")) ? net.i2p.data.DataHelper.stripHTML(request.getParameter("proxyList")) : "" ) %>" class="freetext" />
|
||||
</div><%
|
||||
@@ -263,17 +263,17 @@
|
||||
} else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) {
|
||||
if (curPage == 4) {
|
||||
%><p>
|
||||
<%=intl._("Type in the I2P destination of the service that this client tunnel should connect to.")%>
|
||||
<%=intl._("This could be the full base 64 destination key, or an I2P URL from your address book.")%>
|
||||
<%=intl._t("Type in the I2P destination of the service that this client tunnel should connect to.")%>
|
||||
<%=intl._t("This could be the full base 64 destination key, or an I2P URL from your address book.")%>
|
||||
</p>
|
||||
<div id="destinationField" class="rowItem">
|
||||
<label for="targetDestination" accesskey="T">
|
||||
<%=intl._("Tunnel Destination")%>(<span class="accessKey">T</span>):
|
||||
<%=intl._t("Tunnel Destination")%>(<span class="accessKey">T</span>):
|
||||
</label>
|
||||
<input type="text" size="30" id="targetDestination" name="targetDestination" title="Destination of the Tunnel" value="<%=(!"null".equals(request.getParameter("targetDestination")) ? net.i2p.data.DataHelper.stripHTML(request.getParameter("targetDestination")) : "" ) %>" class="freetext" />
|
||||
<span class="comment">(<%=intl._("name, name:port, or destination")%>
|
||||
<span class="comment">(<%=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")%>
|
||||
<% } %> )
|
||||
</span>
|
||||
</div><%
|
||||
@@ -290,12 +290,12 @@
|
||||
if ((tunnelIsClient && "streamrclient".equals(tunnelType)) || (!tunnelIsClient && !"streamrserver".equals(tunnelType))) {
|
||||
if (curPage == 5) {
|
||||
%><p>
|
||||
<%=intl._("This is the IP that your service is running on, this is usually on the same machine so 127.0.0.1 is autofilled.")%><%
|
||||
//XXX TODO<%=intl._("For some reason streamrclient also uses this.")%>
|
||||
<%=intl._t("This is the IP that your service is running on, this is usually on the same machine so 127.0.0.1 is autofilled.")%><%
|
||||
//XXX TODO<%=intl._t("For some reason streamrclient also uses this.")%>
|
||||
</p>
|
||||
<div id="hostField" class="rowItem">
|
||||
<label for="targetHost" accesskey="H">
|
||||
<%=intl._("Host")%>(<span class="accessKey">H</span>):
|
||||
<%=intl._t("Host")%>(<span class="accessKey">H</span>):
|
||||
</label>
|
||||
<input type="text" size="20" id="targetHost" name="targetHost" title="Target Hostname or IP" value="<%=(!"null".equals(request.getParameter("targetHost")) ? net.i2p.data.DataHelper.stripHTML(request.getParameter("targetHost")) : "127.0.0.1" ) %>" class="freetext" />
|
||||
</div><%
|
||||
@@ -307,11 +307,11 @@
|
||||
if (!tunnelIsClient) {
|
||||
if (curPage == 5) {
|
||||
%><p>
|
||||
<%=intl._("This is the port that the service is accepting connections on.")%>
|
||||
<%=intl._t("This is the port that the service is accepting connections on.")%>
|
||||
</p>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="targetPort" accesskey="P">
|
||||
<%=intl._("Port")%>(<span class="accessKey">P</span>):
|
||||
<%=intl._t("Port")%>(<span class="accessKey">P</span>):
|
||||
</label>
|
||||
<input type="text" size="6" maxlength="5" id="targetPort" name="targetPort" title="Target Port Number" value="<%=(!"null".equals(request.getParameter("targetPort")) ? net.i2p.data.DataHelper.stripHTML(request.getParameter("targetPort")) : "" ) %>" class="freetext" />
|
||||
</div><%
|
||||
@@ -323,8 +323,8 @@
|
||||
if (tunnelIsClient || "httpbidirserver".equals(tunnelType)) {
|
||||
if (curPage == 5) {
|
||||
%><p>
|
||||
<%=intl._("This is the port that the client tunnel will be accessed from locally.")%>
|
||||
<%=intl._("This is also the client port for the HTTPBidir server tunnel.")%>
|
||||
<%=intl._t("This is the port that the client tunnel will be accessed from locally.")%>
|
||||
<%=intl._t("This is also the client port for the HTTPBidir server tunnel.")%>
|
||||
</p>
|
||||
<div id="portField" class="rowItem">
|
||||
<label for="port" accesskey="P">
|
||||
@@ -340,14 +340,14 @@
|
||||
if ((tunnelIsClient && !"streamrclient".equals(tunnelType)) || "httpbidirserver".equals(tunnelType) || "streamrserver".equals(tunnelType)) {
|
||||
if (curPage == 5) {
|
||||
%><p>
|
||||
<%=intl._("How do you want this tunnel to be accessed? By just this machine, your entire subnet, or external internet?")%>
|
||||
<%=intl._("You will most likely want to just allow 127.0.0.1")%><%
|
||||
//XXX TODO<%=intl._("Note that it is relevant to most Client tunnels, and httpbidirserver and streamrserver tunnels.")%><%
|
||||
//XXX TODO<%=intl._("So the wording may need to change slightly for the client vs. server tunnels.")%>
|
||||
<%=intl._t("How do you want this tunnel to be accessed? By just this machine, your entire subnet, or external internet?")%>
|
||||
<%=intl._t("You will most likely want to just allow 127.0.0.1")%><%
|
||||
//XXX TODO<%=intl._t("Note that it is relevant to most Client tunnels, and httpbidirserver and streamrserver tunnels.")%><%
|
||||
//XXX TODO<%=intl._t("So the wording may need to change slightly for the client vs. server tunnels.")%>
|
||||
</p>
|
||||
<div id="reachField" class="rowItem">
|
||||
<label for="reachableBy" accesskey="r">
|
||||
<%=intl._("Reachable by")%>(<span class="accessKey">R</span>):
|
||||
<%=intl._t("Reachable by")%>(<span class="accessKey">R</span>):
|
||||
</label>
|
||||
<select id="reachableBy" name="reachableBy" title="IP for Client Access" class="selectbox">
|
||||
<%
|
||||
@@ -379,15 +379,15 @@
|
||||
|
||||
if (curPage == 6) {
|
||||
%><p>
|
||||
<%=intl._("The I2P router can automatically start this tunnel for you when the router is started.")%>
|
||||
<%=intl._("This can be useful for frequently-used tunnels (especially server tunnels), but for tunnels that are only used occassionally it would mean that the I2P router is creating and maintaining unnecessary tunnels.")%>
|
||||
<%=intl._t("The I2P router can automatically start this tunnel for you when the router is started.")%>
|
||||
<%=intl._t("This can be useful for frequently-used tunnels (especially server tunnels), but for tunnels that are only used occassionally it would mean that the I2P router is creating and maintaining unnecessary tunnels.")%>
|
||||
</p>
|
||||
<div id="startupField" class="rowItem">
|
||||
<label for="startOnLoad" accesskey="a">
|
||||
<%=intl._("Auto Start")%>(<span class="accessKey">A</span>):
|
||||
<%=intl._t("Auto Start")%>(<span class="accessKey">A</span>):
|
||||
</label>
|
||||
<input value="1" type="checkbox" id="startOnLoad" name="startOnLoad" title="Start Tunnel Automatically"<%=("1".equals(request.getParameter("startOnLoad")) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||
<span class="comment"><%=intl._("(Check the Box for 'YES')")%></span>
|
||||
<span class="comment"><%=intl._t("(Check the Box for 'YES')")%></span>
|
||||
</div><%
|
||||
} else {
|
||||
if ("1".equals(request.getParameter("startOnLoad"))) {
|
||||
@@ -401,27 +401,27 @@
|
||||
|
||||
if (curPage == 7) {
|
||||
%><p>
|
||||
<%=intl._("The wizard has now collected enough information to create your tunnel.")%>
|
||||
<%=intl._("Upon clicking the Save button below, the wizard will set up the tunnel, and take you back to the main I2PTunnel page.")%>
|
||||
<%=intl._t("The wizard has now collected enough information to create your tunnel.")%>
|
||||
<%=intl._t("Upon clicking the Save button below, the wizard will set up the tunnel, and take you back to the main I2PTunnel page.")%>
|
||||
<%
|
||||
if ("1".equals(request.getParameter("startOnLoad"))) {
|
||||
%><%=intl._("Because you chose to automatically start the tunnel when the router starts, you don't have to do anything further.")%>
|
||||
<%=intl._("The router will start the tunnel once it has been set up.")%><%
|
||||
%><%=intl._t("Because you chose to automatically start the tunnel when the router starts, you don't have to do anything further.")%>
|
||||
<%=intl._t("The router will start the tunnel once it has been set up.")%><%
|
||||
} else {
|
||||
%><%=intl._("Because you chose not to automatically start the tunnel, you will have to manually start it.")%>
|
||||
<%=intl._("You can do this by clicking the Start button on the main page which corresponds to the new tunnel.")%><%
|
||||
%><%=intl._t("Because you chose not to automatically start the tunnel, you will have to manually start it.")%>
|
||||
<%=intl._t("You can do this by clicking the Start button on the main page which corresponds to the new tunnel.")%><%
|
||||
} %>
|
||||
</p>
|
||||
<p>
|
||||
<%=intl._("Below is a summary of the options you chose:")%>
|
||||
<%=intl._t("Below is a summary of the options you chose:")%>
|
||||
</p>
|
||||
<table>
|
||||
<tr><td><%=intl._("Server or client tunnel?")%></td><td>
|
||||
<tr><td><%=intl._t("Server or client tunnel?")%></td><td>
|
||||
<%=(tunnelIsClient ? "Client" : "Server")%>
|
||||
</td></tr>
|
||||
<tr><td><%=intl._("Tunnel type")%></td><td><%
|
||||
<tr><td><%=intl._t("Tunnel type")%></td><td><%
|
||||
if ("client".equals(tunnelType) || "server".equals(tunnelType)) { %>
|
||||
<%=intl._("Standard")%><%
|
||||
<%=intl._t("Standard")%><%
|
||||
} else if ("httpclient".equals(tunnelType) || "httpserver".equals(tunnelType)) { %>
|
||||
HTTP<%
|
||||
} else if ("httpbidirserver".equals(tunnelType)) { %>
|
||||
@@ -438,12 +438,12 @@
|
||||
Streamr<%
|
||||
} %>
|
||||
</td></tr>
|
||||
<tr><td><%=intl._("Tunnel name and description")%></td><td>
|
||||
<tr><td><%=intl._t("Tunnel name and description")%></td><td>
|
||||
<%=net.i2p.data.DataHelper.stripHTML(request.getParameter("name"))%><br />
|
||||
<%=net.i2p.data.DataHelper.stripHTML(request.getParameter("nofilter_description"))%>
|
||||
</td></tr><%
|
||||
if (tunnelIsClient) { %>
|
||||
<tr><td><%=intl._("Tunnel destination")%></td><td><%
|
||||
<tr><td><%=intl._t("Tunnel destination")%></td><td><%
|
||||
if ("httpclient".equals(tunnelType) || "connectclient".equals(tunnelType) || "sockstunnel".equals(tunnelType) || "socksirctunnel".equals(tunnelType)) { %>
|
||||
<%=net.i2p.data.DataHelper.stripHTML(request.getParameter("proxyList"))%><%
|
||||
} else if ("client".equals(tunnelType) || "ircclient".equals(tunnelType) || "streamrclient".equals(tunnelType)) { %>
|
||||
@@ -451,7 +451,7 @@
|
||||
} %>
|
||||
</td></tr><%
|
||||
} %>
|
||||
<tr><td><%=intl._("Binding address and port")%></td><td><%
|
||||
<tr><td><%=intl._t("Binding address and port")%></td><td><%
|
||||
if ((tunnelIsClient && "streamrclient".equals(tunnelType)) || (!tunnelIsClient && !"streamrserver".equals(tunnelType))) { %>
|
||||
<%=net.i2p.data.DataHelper.stripHTML(request.getParameter("targetHost"))%><br /><%
|
||||
}
|
||||
@@ -465,7 +465,7 @@
|
||||
<br /><%=net.i2p.data.DataHelper.stripHTML(request.getParameter("reachableBy"))%><%
|
||||
} %>
|
||||
</td></tr>
|
||||
<tr><td><%=intl._("Tunnel auto-start")%></td><td><%
|
||||
<tr><td><%=intl._t("Tunnel auto-start")%></td><td><%
|
||||
if ("1".equals(request.getParameter("startOnLoad"))) { %>
|
||||
Yes<%
|
||||
} else { %>
|
||||
@@ -474,8 +474,8 @@
|
||||
</td></tr>
|
||||
</table>
|
||||
<p>
|
||||
<%=intl._("Alongside these basic settings, there are a number of advanced options for tunnel configuration.")%>
|
||||
<%=intl._("The wizard will set reasonably sensible default values for these, but you can view and/or edit these by clicking on the tunnel's name in the main I2PTunnel page.")%>
|
||||
<%=intl._t("Alongside these basic settings, there are a number of advanced options for tunnel configuration.")%>
|
||||
<%=intl._t("The wizard will set reasonably sensible default values for these, but you can view and/or edit these by clicking on the tunnel's name in the main I2PTunnel page.")%>
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="tunnelDepth" value="3" />
|
||||
@@ -533,16 +533,16 @@ http://stats.i2p/cgi-bin/jump.cgi?a=" /><%
|
||||
<div class="header"></div>
|
||||
<div class="footer">
|
||||
<div class="toolbox">
|
||||
<a class="control" href="list"><%=intl._("Cancel")%></a>
|
||||
<a class="control" href="list"><%=intl._t("Cancel")%></a>
|
||||
<% if (curPage != 1 && curPage != 7) {
|
||||
%><button id="controlPrevious" accesskey="P" class="control" type="submit" name="action" value="Previous page" title="Previous Page"><%=intl._("Previous")%>(<span class="accessKey">P</span>)</button><%
|
||||
%><button id="controlPrevious" accesskey="P" class="control" type="submit" name="action" value="Previous page" title="Previous Page"><%=intl._t("Previous")%>(<span class="accessKey">P</span>)</button><%
|
||||
} %>
|
||||
<% if (curPage == 7) {
|
||||
%><button id="controlSave" accesskey="S" class="control" type="submit" name="action" value="Save changes" title="Save Tunnel"><%=intl._("Save Tunnel")%>(<span class="accessKey">S</span>)</button><%
|
||||
%><button id="controlSave" accesskey="S" class="control" type="submit" name="action" value="Save changes" title="Save Tunnel"><%=intl._t("Save Tunnel")%>(<span class="accessKey">S</span>)</button><%
|
||||
} else if (curPage == 6) {
|
||||
%><button id="controlFinish" accesskey="F" class="control" type="submit" name="action" value="Next page" title="Finish Wizard"><%=intl._("Finish")%>(<span class="accessKey">F</span>)</button><%
|
||||
%><button id="controlFinish" accesskey="F" class="control" type="submit" name="action" value="Next page" title="Finish Wizard"><%=intl._t("Finish")%>(<span class="accessKey">F</span>)</button><%
|
||||
} else {
|
||||
%><button id="controlNext" accesskey="N" class="control" type="submit" name="action" value="Next page" title="Next Page"><%=intl._("Next")%>(<span class="accessKey">N</span>)</button><%
|
||||
%><button id="controlNext" accesskey="N" class="control" type="submit" name="action" value="Next page" title="Next Page"><%=intl._t("Next")%>(<span class="accessKey">N</span>)</button><%
|
||||
} %>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -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
|
||||
|
@@ -124,7 +124,7 @@ public class I2PSocketException extends SocketException {
|
||||
|
||||
default:
|
||||
// Translate this one here, can't do it later
|
||||
return _("Failure code") + ": " + _status;
|
||||
return _t("Failure code") + ": " + _status;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,13 +136,13 @@ public class I2PSocketException extends SocketException {
|
||||
String s = getMessage();
|
||||
if (s == null)
|
||||
return null;
|
||||
return _(s);
|
||||
return _t(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate
|
||||
*/
|
||||
private static String _(String s) {
|
||||
private static String _t(String s) {
|
||||
return Translate.getString(s, I2PAppContext.getGlobalContext(), BUNDLE_NAME);
|
||||
}
|
||||
|
||||
|
@@ -43,7 +43,7 @@ then
|
||||
mkdir -p build
|
||||
echo '// Automatically generated pseudo-java for xgettext - do not edit' > $JFILE
|
||||
echo '// Translators may wish to translate a few of these, do not bother to translate all of them!!' >> $JFILE
|
||||
sed -e '/^#/d' -e 's/..,\(..*\)/_("\1");/' $CFILE >> $JFILE
|
||||
sed -e '/^#/d' -e 's/..,\(..*\)/_t("\1");/' $CFILE >> $JFILE
|
||||
fi
|
||||
|
||||
# add ../java/ so the refs will work in the po file
|
||||
@@ -76,16 +76,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 -L java --from-code=UTF-8 --no-location\
|
||||
--keyword=_ \
|
||||
--keyword=_t \
|
||||
-o ${i}t
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
|
@@ -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 -L java --from-code=UTF-8 --no-location\
|
||||
--keyword=_ \
|
||||
--keyword=_t \
|
||||
-o ${i}t
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
|
@@ -84,19 +84,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
|
||||
|
@@ -881,7 +881,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
break;
|
||||
|
||||
case PLUGIN:
|
||||
msg = "<b>" + _("New plugin version {0} is available", newVersion) + "</b>";
|
||||
msg = "<b>" + _t("New plugin version {0} is available", newVersion) + "</b>";
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -961,11 +961,11 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
|
||||
case PLUGIN:
|
||||
if (!success) {
|
||||
msg = _("Update check failed for plugin {0}", task.getID());
|
||||
msg = _t("Update check failed for plugin {0}", task.getID());
|
||||
_log.logAlways(Log.WARN, msg);
|
||||
msg = "<b>" + msg + "</b>";
|
||||
} else if (!newer) {
|
||||
msg = "<b>" + _("No new version is available for plugin {0}", task.getID()) + "</b>";
|
||||
msg = "<b>" + _t("No new version is available for plugin {0}", task.getID()) + "</b>";
|
||||
}
|
||||
/// else success.... message for that?
|
||||
|
||||
@@ -989,7 +989,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
buf.append(_pct.format(pct));
|
||||
}
|
||||
buf.append("<br>\n");
|
||||
buf.append(_("{0}B transferred", DataHelper.formatSize2(downloaded)));
|
||||
buf.append(_t("{0}B transferred", DataHelper.formatSize2(downloaded)));
|
||||
updateStatus(buf.toString());
|
||||
}
|
||||
|
||||
@@ -1048,9 +1048,9 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
String uri = task.getURI().toString();
|
||||
if (uri.startsWith("file:") || task.getMethod() == FILE) {
|
||||
uri = DataHelper.stripHTML(task.getURI().getPath());
|
||||
buf.append(_("Install failed from {0}", uri));
|
||||
buf.append(_t("Install failed from {0}", uri));
|
||||
} else {
|
||||
buf.append(_("Transfer failed from {0}", uri));
|
||||
buf.append(_t("Transfer failed from {0}", uri));
|
||||
}
|
||||
if (reason != null && reason.length() > 0) {
|
||||
buf.append("<br>");
|
||||
@@ -1325,7 +1325,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
*/
|
||||
private boolean handleRouterFile(URI uri, String actualVersion, File f, boolean isSU3) {
|
||||
String url = uri.toString();
|
||||
updateStatus("<b>" + _("Update downloaded") + "</b>");
|
||||
updateStatus("<b>" + _t("Update downloaded") + "</b>");
|
||||
File to = new File(_context.getRouterDir(), Router.UPDATE_FILE);
|
||||
String err;
|
||||
// Process the file
|
||||
@@ -1369,7 +1369,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
|
||||
if ("install".equals(policy)) {
|
||||
_log.log(Log.CRIT, "Update was downloaded and verified, restarting to install it");
|
||||
updateStatus("<b>" + _("Update verified") + "</b><br>" + _("Restarting"));
|
||||
updateStatus("<b>" + _t("Update verified") + "</b><br>" + _t("Restarting"));
|
||||
restart();
|
||||
} else {
|
||||
_log.logAlways(Log.WARN, "Update was downloaded and verified, will be installed at next restart");
|
||||
@@ -1378,7 +1378,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
}
|
||||
} else {
|
||||
_log.log(Log.CRIT, err + " from " + url);
|
||||
updateStatus("<b>" + err + ' ' + _("from {0}", linkify(url)) + " </b>");
|
||||
updateStatus("<b>" + err + ' ' + _t("from {0}", linkify(url)) + " </b>");
|
||||
}
|
||||
return err == null;
|
||||
}
|
||||
@@ -1389,11 +1389,11 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
*/
|
||||
private boolean handleUnsignedFile(URI uri, String lastmod, File updFile) {
|
||||
if (FileUtil.verifyZip(updFile)) {
|
||||
updateStatus("<b>" + _("Update downloaded") + "</b>");
|
||||
updateStatus("<b>" + _t("Update downloaded") + "</b>");
|
||||
} else {
|
||||
updFile.delete();
|
||||
String url = uri.toString();
|
||||
updateStatus("<b>" + _("Unsigned update file from {0} is corrupt", url) + "</b>");
|
||||
updateStatus("<b>" + _t("Unsigned update file from {0} is corrupt", url) + "</b>");
|
||||
_log.log(Log.CRIT, "Corrupt zip file from " + url);
|
||||
return false;
|
||||
}
|
||||
@@ -1413,7 +1413,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
_context.router().saveConfig(NewsHelper.PROP_LAST_UPDATE_TIME, Long.toString(modtime));
|
||||
if ("install".equals(policy)) {
|
||||
_log.log(Log.CRIT, "Update was downloaded, restarting to install it");
|
||||
updateStatus("<b>" + _("Update downloaded") + "</b><br>" + _("Restarting"));
|
||||
updateStatus("<b>" + _t("Update downloaded") + "</b><br>" + _t("Restarting"));
|
||||
restart();
|
||||
} else {
|
||||
_log.logAlways(Log.WARN, "Update was downloaded, will be installed at next restart");
|
||||
@@ -1422,7 +1422,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
}
|
||||
} else {
|
||||
_log.log(Log.CRIT, "Failed copy to " + to);
|
||||
updateStatus("<b>" + _("Failed copy to {0}", to.getAbsolutePath()) + "</b>");
|
||||
updateStatus("<b>" + _t("Failed copy to {0}", to.getAbsolutePath()) + "</b>");
|
||||
}
|
||||
return copied;
|
||||
}
|
||||
@@ -1453,14 +1453,14 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
}
|
||||
|
||||
/** translate a string */
|
||||
public String _(String s) {
|
||||
public String _t(String s) {
|
||||
return Messages.getString(s, _context);
|
||||
}
|
||||
|
||||
/**
|
||||
* translate a string with a parameter
|
||||
*/
|
||||
public String _(String s, Object o) {
|
||||
public String _t(String s, Object o) {
|
||||
return Messages.getString(s, o, _context);
|
||||
}
|
||||
|
||||
@@ -1468,7 +1468,7 @@ public class ConsoleUpdateManager implements UpdateManager, RouterApp {
|
||||
* translate a string with parameters
|
||||
* @since 0.9.9
|
||||
*/
|
||||
public String _(String s, Object o, Object o2) {
|
||||
public String _t(String s, Object o, Object o2) {
|
||||
return Messages.getString(s, o, o2, _context);
|
||||
}
|
||||
|
||||
|
@@ -44,14 +44,14 @@ class DevSU3UpdateChecker extends UpdateRunner {
|
||||
if (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
|
||||
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
|
||||
_context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
|
||||
String msg = _("HTTP client proxy tunnel must be running");
|
||||
String msg = _t("HTTP client proxy tunnel must be running");
|
||||
if (_log.shouldWarn())
|
||||
_log.warn(msg);
|
||||
updateStatus("<b>" + msg + "</b>");
|
||||
_mgr.notifyCheckComplete(this, false, false);
|
||||
return;
|
||||
}
|
||||
//updateStatus("<b>" + _("Checking for development build update") + "</b>");
|
||||
//updateStatus("<b>" + _t("Checking for development build update") + "</b>");
|
||||
_baos.reset();
|
||||
try {
|
||||
_get = new PartialEepGet(_context, proxyHost, proxyPort, _baos, _currentURI.toString(), TrustedUpdate.HEADER_BYTES);
|
||||
@@ -76,7 +76,7 @@ class DevSU3UpdateChecker extends UpdateRunner {
|
||||
_mgr.notifyVersionAvailable(this, _currentURI, UpdateType.ROUTER_DEV_SU3, "", UpdateMethod.HTTP,
|
||||
_urls, newVersion, RouterVersion.FULL_VERSION);
|
||||
} else {
|
||||
//updateStatus("<b>" + _("No new version found at {0}", linkify(url)) + "</b>");
|
||||
//updateStatus("<b>" + _t("No new version found at {0}", linkify(url)) + "</b>");
|
||||
if (_log.shouldWarn())
|
||||
_log.warn("Found old version \"" + newVersion + "\" at " + url);
|
||||
}
|
||||
|
@@ -88,7 +88,7 @@ class DevSU3UpdateHandler implements Checker, Updater {
|
||||
return null;
|
||||
UpdateRunner update = new DevSU3UpdateRunner(_context, _mgr, updateSources);
|
||||
// set status before thread to ensure UI feedback
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._("Updating") + "</b>");
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._t("Updating") + "</b>");
|
||||
return update;
|
||||
}
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ class DevSU3UpdateRunner extends UpdateRunner {
|
||||
if (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
|
||||
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
|
||||
_context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
|
||||
String msg = _("HTTP client proxy tunnel must be running");
|
||||
String msg = _t("HTTP client proxy tunnel must be running");
|
||||
if (_log.shouldWarn())
|
||||
_log.warn(msg);
|
||||
updateStatus("<b>" + msg + "</b>");
|
||||
|
@@ -215,13 +215,13 @@ class NewsFetcher extends UpdateRunner {
|
||||
_log.debug("Found version: [" + ver + "]");
|
||||
if (TrustedUpdate.needsUpdate(RouterVersion.VERSION, ver)) {
|
||||
if (NewsHelper.isUpdateDisabled(_context)) {
|
||||
String msg = _mgr._("In-network updates disabled. Check package manager.");
|
||||
String msg = _mgr._t("In-network updates disabled. Check package manager.");
|
||||
_log.logAlways(Log.WARN, "Cannot update to version " + ver + ": " + msg);
|
||||
_mgr.notifyVersionConstraint(this, _currentURI, ROUTER_SIGNED, "", ver, msg);
|
||||
return;
|
||||
}
|
||||
if (NewsHelper.isBaseReadonly(_context)) {
|
||||
String msg = _mgr._("No write permission for I2P install directory.");
|
||||
String msg = _mgr._t("No write permission for I2P install directory.");
|
||||
_log.logAlways(Log.WARN, "Cannot update to version " + ver + ": " + msg);
|
||||
_mgr.notifyVersionConstraint(this, _currentURI, ROUTER_SIGNED, "", ver, msg);
|
||||
return;
|
||||
@@ -229,7 +229,7 @@ class NewsFetcher extends UpdateRunner {
|
||||
String minRouter = args.get(MIN_VERSION_KEY);
|
||||
if (minRouter != null) {
|
||||
if (VersionComparator.comp(RouterVersion.VERSION, minRouter) < 0) {
|
||||
String msg = _mgr._("You must first update to version {0}", minRouter);
|
||||
String msg = _mgr._t("You must first update to version {0}", minRouter);
|
||||
_log.logAlways(Log.WARN, "Cannot update to version " + ver + ": " + msg);
|
||||
_mgr.notifyVersionConstraint(this, _currentURI, ROUTER_SIGNED, "", ver, msg);
|
||||
return;
|
||||
@@ -239,7 +239,7 @@ class NewsFetcher extends UpdateRunner {
|
||||
if (minJava != null) {
|
||||
String ourJava = System.getProperty("java.version");
|
||||
if (VersionComparator.comp(ourJava, minJava) < 0) {
|
||||
String msg = _mgr._("Requires Java version {0} but installed Java version is {1}", minJava, ourJava);
|
||||
String msg = _mgr._t("Requires Java version {0} but installed Java version is {1}", minJava, ourJava);
|
||||
_log.logAlways(Log.WARN, "Cannot update to version " + ver + ": " + msg);
|
||||
_mgr.notifyVersionConstraint(this, _currentURI, ROUTER_SIGNED, "", ver, msg);
|
||||
return;
|
||||
|
@@ -52,14 +52,14 @@ class PluginUpdateChecker extends UpdateRunner {
|
||||
if (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
|
||||
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
|
||||
_context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
|
||||
String msg = _("HTTP client proxy tunnel must be running");
|
||||
String msg = _t("HTTP client proxy tunnel must be running");
|
||||
if (_log.shouldWarn())
|
||||
_log.warn(msg);
|
||||
updateStatus("<b>" + msg + "</b>");
|
||||
_mgr.notifyCheckComplete(this, false, false);
|
||||
return;
|
||||
}
|
||||
updateStatus("<b>" + _("Checking for update of plugin {0}", _appName) + "</b>");
|
||||
updateStatus("<b>" + _t("Checking for update of plugin {0}", _appName) + "</b>");
|
||||
_baos.reset();
|
||||
try {
|
||||
_get = new PartialEepGet(_context, proxyHost, proxyPort, _baos, _currentURI.toString(), TrustedUpdate.HEADER_BYTES);
|
||||
|
@@ -54,7 +54,7 @@ class PluginUpdateHandler implements Checker, Updater {
|
||||
}
|
||||
|
||||
if (oldVersion == null || updateSources == null) {
|
||||
//updateStatus("<b>" + _("Cannot check, plugin {0} is not installed", appName) + "</b>");
|
||||
//updateStatus("<b>" + _t("Cannot check, plugin {0} is not installed", appName) + "</b>");
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ class PluginUpdateHandler implements Checker, Updater {
|
||||
|
||||
UpdateRunner update = new PluginUpdateRunner(_context, _mgr, updateSources, appName, oldVersion);
|
||||
// set status before thread to ensure UI feedback
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._("Updating") + "</b>");
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._t("Updating") + "</b>");
|
||||
return update;
|
||||
}
|
||||
}
|
||||
|
@@ -87,15 +87,15 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
// strip off file:// or just file:
|
||||
String xpi2pfile = _uri.getPath();
|
||||
if(xpi2pfile == null || xpi2pfile.length() == 0) {
|
||||
statusDone("<b>" + _("Bad URL {0}", _xpi2pURL) + "</b>");
|
||||
statusDone("<b>" + _t("Bad URL {0}", _xpi2pURL) + "</b>");
|
||||
} else {
|
||||
// copy the contents of from to _updateFile
|
||||
long alreadyTransferred = (new File(xpi2pfile)).getAbsoluteFile().length();
|
||||
if(FileUtil.copy((new File(xpi2pfile)).getAbsolutePath(), _updateFile, true, false)) {
|
||||
updateStatus("<b>" + _("Attempting to install from file {0}", _xpi2pURL) + "</b>");
|
||||
updateStatus("<b>" + _t("Attempting to install from file {0}", _xpi2pURL) + "</b>");
|
||||
transferComplete(alreadyTransferred, alreadyTransferred, 0L, _xpi2pURL, _updateFile, false);
|
||||
} else {
|
||||
statusDone("<b>" + _("Failed to install from file {0}, copy failed.", _xpi2pURL) + "</b>");
|
||||
statusDone("<b>" + _t("Failed to install from file {0}, copy failed.", _xpi2pURL) + "</b>");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -108,14 +108,14 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
if (shouldProxy && proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
|
||||
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
|
||||
_context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
|
||||
String msg = _("HTTP client proxy tunnel must be running");
|
||||
String msg = _t("HTTP client proxy tunnel must be running");
|
||||
if (_log.shouldWarn())
|
||||
_log.warn(msg);
|
||||
statusDone("<b>" + msg + "</b>");
|
||||
_mgr.notifyTaskFailed(this, msg, null);
|
||||
return;
|
||||
}
|
||||
updateStatus("<b>" + _("Downloading plugin from {0}", _xpi2pURL) + "</b>");
|
||||
updateStatus("<b>" + _t("Downloading plugin from {0}", _xpi2pURL) + "</b>");
|
||||
try {
|
||||
if (shouldProxy)
|
||||
// 10 retries!!
|
||||
@@ -136,12 +136,12 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
|
||||
@Override
|
||||
public void transferComplete(long alreadyTransferred, long bytesTransferred, long bytesRemaining, String url, String outputFile, boolean notModified) {
|
||||
updateStatus("<b>" + _("Plugin downloaded") + "</b>");
|
||||
updateStatus("<b>" + _t("Plugin downloaded") + "</b>");
|
||||
File f = new File(_updateFile);
|
||||
File appDir = new SecureDirectory(_context.getConfigDir(), PLUGIN_DIR);
|
||||
if ((!appDir.exists()) && (!appDir.mkdir())) {
|
||||
f.delete();
|
||||
statusDone("<b>" + _("Cannot create plugin directory {0}", appDir.getAbsolutePath()) + "</b>");
|
||||
statusDone("<b>" + _t("Cannot create plugin directory {0}", appDir.getAbsolutePath()) + "</b>");
|
||||
return;
|
||||
}
|
||||
boolean isSU3;
|
||||
@@ -186,7 +186,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
// extract to a zip file whether the sig is good or not, so we can get the properties file
|
||||
String err = up.migrateFile(f, to);
|
||||
if (err != null) {
|
||||
statusDone("<b>" + err + ' ' + _("from {0}", url) + " </b>");
|
||||
statusDone("<b>" + err + ' ' + _t("from {0}", url) + " </b>");
|
||||
f.delete();
|
||||
to.delete();
|
||||
return;
|
||||
@@ -202,7 +202,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
f.delete();
|
||||
to.delete();
|
||||
//updateStatus("<b>" + "Plugin contains an invalid key" + ' ' + pubkey + ' ' + signer + "</b>");
|
||||
statusDone("<b>" + _("Plugin from {0} contains an invalid key", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin from {0} contains an invalid key", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
SigningPublicKey spk;
|
||||
@@ -211,7 +211,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
} catch (DataFormatException dfe) {
|
||||
f.delete();
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin from {0} contains an invalid key", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin from {0} contains an invalid key", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
_log.error("Failed to verify plugin signature, corrupt plugin or bad signature, signed by: " + signer);
|
||||
else
|
||||
_log.error("Plugin signer \"" + signer + "\" does not match existing signer in plugin.config file \"" + signingKeyName + "\"");
|
||||
statusDone("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin signature verification of {0} failed", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
} else if (_context.getBooleanProperty(PROP_ALLOW_NEW_KEYS)) {
|
||||
@@ -254,7 +254,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
f.delete();
|
||||
to.delete();
|
||||
_log.error("Bad key or key mismatch - Failed to add plugin key \"" + pubkey + "\" for plugin signer \"" + signer + "\"");
|
||||
statusDone("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin signature verification of {0} failed", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
// ...and try the verify again
|
||||
@@ -268,7 +268,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
else
|
||||
// shouldn't happen
|
||||
_log.error("Plugin signer \"" + signer + "\" does not match new signer in plugin.config file \"" + signingKeyName + "\"");
|
||||
statusDone("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin signature verification of {0} failed", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
@@ -277,7 +277,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
to.delete();
|
||||
_log.error("Untrusted plugin key \"" + pubkey + "\" for plugin signer \"" + signer + "\"");
|
||||
// don't display signer, we're really checking the key not the signer name
|
||||
statusDone("<b>" + _("Plugin not installed - signer is untrusted") + "</b>");
|
||||
statusDone("<b>" + _t("Plugin not installed - signer is untrusted") + "</b>");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
sudVersion = su3.getVersionString();
|
||||
signingKeyName = su3.getSignerString();
|
||||
} catch (IOException ioe) {
|
||||
statusDone("<b>" + ioe + ' ' + _("from {0}", url) + " </b>");
|
||||
statusDone("<b>" + ioe + ' ' + _t("from {0}", url) + " </b>");
|
||||
f.delete();
|
||||
to.delete();
|
||||
return;
|
||||
@@ -315,7 +315,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
if (signer == null || signer.length() <= 0) {
|
||||
f.delete();
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin from {0} contains an invalid key", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin from {0} contains an invalid key", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
if (!signer.equals(signingKeyName)) {
|
||||
@@ -326,7 +326,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
else
|
||||
// shouldn't happen
|
||||
_log.error("Plugin signer \"" + signer + "\" does not match new signer in plugin.config file \"" + signingKeyName + "\"");
|
||||
statusDone("<b>" + _("Plugin signature verification of {0} failed", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin signature verification of {0} failed", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
processFinal(to, appDir, url, props, sudVersion, null, signer);
|
||||
@@ -342,7 +342,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
f.delete();
|
||||
to.delete();
|
||||
FileUtil.rmdir(tempDir, false);
|
||||
statusDone("<b>" + _("Plugin from {0} is corrupt", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin from {0} is corrupt", url) + "</b>");
|
||||
return null;
|
||||
}
|
||||
File installProps = new File(tempDir, "plugin.config");
|
||||
@@ -352,7 +352,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
} catch (IOException ioe) {
|
||||
f.delete();
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin from {0} does not contain the required configuration file", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin from {0} does not contain the required configuration file", url) + "</b>");
|
||||
return null;
|
||||
} finally {
|
||||
// we don't need this anymore, we will unzip again
|
||||
@@ -374,12 +374,12 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
version.indexOf("<") >= 0 || version.indexOf(">") >= 0 ||
|
||||
appName.startsWith(".") || appName.indexOf("/") >= 0 || appName.indexOf("\\") >= 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin from {0} has invalid name or version", url) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin from {0} has invalid name or version", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
if (!version.equals(sudVersion)) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin {0} has mismatched versions", appName) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin {0} has mismatched versions", appName) + "</b>");
|
||||
return;
|
||||
}
|
||||
// set so notifyComplete() will work
|
||||
@@ -390,7 +390,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
if (minVersion != null &&
|
||||
VersionComparator.comp(CoreVersion.VERSION, minVersion) < 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("This plugin requires I2P version {0} or higher", minVersion) + "</b>");
|
||||
statusDone("<b>" + _t("This plugin requires I2P version {0} or higher", minVersion) + "</b>");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -398,7 +398,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
if (minVersion != null &&
|
||||
VersionComparator.comp(System.getProperty("java.version"), minVersion) < 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("This plugin requires Java version {0} or higher", minVersion) + "</b>");
|
||||
statusDone("<b>" + _t("This plugin requires Java version {0} or higher", minVersion) + "</b>");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -407,7 +407,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
if (destDir.exists()) {
|
||||
if (Boolean.valueOf(props.getProperty("install-only")).booleanValue()) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Downloaded plugin is for new installs only, but the plugin is already installed", url) + "</b>");
|
||||
statusDone("<b>" + _t("Downloaded plugin is for new installs only, but the plugin is already installed", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
// compare previous version
|
||||
@@ -417,7 +417,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
DataHelper.loadProps(oldProps, oldPropFile);
|
||||
} catch (IOException ioe) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Installed plugin does not contain the required configuration file", url) + "</b>");
|
||||
statusDone("<b>" + _t("Installed plugin does not contain the required configuration file", url) + "</b>");
|
||||
return;
|
||||
}
|
||||
String oldPubkey = oldProps.getProperty("key");
|
||||
@@ -425,28 +425,28 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
String oldAppName = oldProps.getProperty("name");
|
||||
if ((pubkey != null && !pubkey.equals(oldPubkey)) || (!signer.equals(oldKeyName)) || (!appName.equals(oldAppName))) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Signature of downloaded plugin does not match installed plugin") + "</b>");
|
||||
statusDone("<b>" + _t("Signature of downloaded plugin does not match installed plugin") + "</b>");
|
||||
return;
|
||||
}
|
||||
String oldVersion = oldProps.getProperty("version");
|
||||
if (oldVersion == null ||
|
||||
VersionComparator.comp(oldVersion, version) >= 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Downloaded plugin version {0} is not newer than installed plugin", version) + "</b>");
|
||||
statusDone("<b>" + _t("Downloaded plugin version {0} is not newer than installed plugin", version) + "</b>");
|
||||
return;
|
||||
}
|
||||
minVersion = ConfigClientsHelper.stripHTML(props, "min-installed-version");
|
||||
if (minVersion != null &&
|
||||
VersionComparator.comp(minVersion, oldVersion) > 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin update requires installed plugin version {0} or higher", minVersion) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin update requires installed plugin version {0} or higher", minVersion) + "</b>");
|
||||
return;
|
||||
}
|
||||
String maxVersion = ConfigClientsHelper.stripHTML(props, "max-installed-version");
|
||||
if (maxVersion != null &&
|
||||
VersionComparator.comp(maxVersion, oldVersion) < 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin update requires installed plugin version {0} or lower", maxVersion) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin update requires installed plugin version {0} or lower", maxVersion) + "</b>");
|
||||
return;
|
||||
}
|
||||
oldVersion = LogsHelper.jettyVersion();
|
||||
@@ -454,14 +454,14 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
if (minVersion != null &&
|
||||
VersionComparator.comp(minVersion, oldVersion) > 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin requires Jetty version {0} or higher", minVersion) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin requires Jetty version {0} or higher", minVersion) + "</b>");
|
||||
return;
|
||||
}
|
||||
maxVersion = ConfigClientsHelper.stripHTML(props, "max-jetty-version");
|
||||
if (maxVersion != null &&
|
||||
VersionComparator.comp(maxVersion, oldVersion) < 0) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin requires Jetty version {0} or lower", maxVersion) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin requires Jetty version {0} or lower", maxVersion) + "</b>");
|
||||
return;
|
||||
}
|
||||
// do we defer extraction and installation?
|
||||
@@ -470,7 +470,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
try {
|
||||
if(!FileUtil.copy(to, (new SecureFile( new SecureFile(appDir.getCanonicalPath() +"/" + appName +"/"+ ZIP).getCanonicalPath())) , true, true)) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Cannot copy plugin to directory {0}", destDir.getAbsolutePath()) + "</b>");
|
||||
statusDone("<b>" + _t("Cannot copy plugin to directory {0}", destDir.getAbsolutePath()) + "</b>");
|
||||
return;
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
@@ -480,7 +480,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
}
|
||||
// we don't need the original file anymore.
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin will be installed on next restart.") + "</b>");
|
||||
statusDone("<b>" + _t("Plugin will be installed on next restart.") + "</b>");
|
||||
return;
|
||||
}
|
||||
if (PluginStarter.isPluginRunning(appName, _context)) {
|
||||
@@ -498,12 +498,12 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
} else {
|
||||
if (Boolean.valueOf(props.getProperty("update-only")).booleanValue()) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Plugin is for upgrades only, but the plugin is not installed") + "</b>");
|
||||
statusDone("<b>" + _t("Plugin is for upgrades only, but the plugin is not installed") + "</b>");
|
||||
return;
|
||||
}
|
||||
if (!destDir.mkdir()) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Cannot create plugin directory {0}", destDir.getAbsolutePath()) + "</b>");
|
||||
statusDone("<b>" + _t("Cannot create plugin directory {0}", destDir.getAbsolutePath()) + "</b>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -511,14 +511,14 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
// Finally, extract the zip to the plugin directory
|
||||
if (!FileUtil.extractZip(to, destDir, Log.WARN)) {
|
||||
to.delete();
|
||||
statusDone("<b>" + _("Failed to install plugin in {0}", destDir.getAbsolutePath()) + "</b>");
|
||||
statusDone("<b>" + _t("Failed to install plugin in {0}", destDir.getAbsolutePath()) + "</b>");
|
||||
return;
|
||||
}
|
||||
_updated = true;
|
||||
to.delete();
|
||||
// install != update. Changing the user's settings like this is probabbly a bad idea.
|
||||
if (Boolean.valueOf( props.getProperty("dont-start-at-install")).booleanValue()) {
|
||||
statusDone("<b>" + _("Plugin {0} installed", appName) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin {0} installed", appName) + "</b>");
|
||||
if(!update) {
|
||||
Properties pluginProps = PluginStarter.pluginProperties();
|
||||
pluginProps.setProperty(PluginStarter.PREFIX + appName + PluginStarter.ENABLED, "false");
|
||||
@@ -537,16 +537,16 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
link = "<a target=\"_blank\" href=\"" + linkURL + "\"/>" + linkName + "</a>";
|
||||
else
|
||||
link = appName;
|
||||
statusDone("<b>" + _("Plugin {0} installed and started", link) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin {0} installed and started", link) + "</b>");
|
||||
}
|
||||
else
|
||||
statusDone("<b>" + _("Plugin {0} installed but failed to start, check logs", appName) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin {0} installed but failed to start, check logs", appName) + "</b>");
|
||||
} catch (Throwable e) {
|
||||
statusDone("<b>" + _("Plugin {0} installed but failed to start", appName) + ": " + e + "</b>");
|
||||
statusDone("<b>" + _t("Plugin {0} installed but failed to start", appName) + ": " + e + "</b>");
|
||||
_log.error("Error starting plugin " + appName, e);
|
||||
}
|
||||
} else {
|
||||
statusDone("<b>" + _("Plugin {0} installed", appName) + "</b>");
|
||||
statusDone("<b>" + _t("Plugin {0} installed", appName) + "</b>");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -554,7 +554,7 @@ class PluginUpdateRunner extends UpdateRunner {
|
||||
public void transferFailed(String url, long bytesTransferred, long bytesRemaining, int currentAttempt) {
|
||||
File f = new File(_updateFile);
|
||||
f.delete();
|
||||
statusDone("<b>" + _("Failed to download plugin from {0}", url) + "</b>");
|
||||
statusDone("<b>" + _t("Failed to download plugin from {0}", url) + "</b>");
|
||||
}
|
||||
|
||||
private void statusDone(String msg) {
|
||||
|
@@ -59,14 +59,14 @@ class UnsignedUpdateChecker extends UpdateRunner {
|
||||
if (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
|
||||
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
|
||||
_context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
|
||||
String msg = _("HTTP client proxy tunnel must be running");
|
||||
String msg = _t("HTTP client proxy tunnel must be running");
|
||||
if (_log.shouldWarn())
|
||||
_log.warn(msg);
|
||||
updateStatus("<b>" + msg + "</b>");
|
||||
return false;
|
||||
}
|
||||
|
||||
//updateStatus("<b>" + _("Checking for development build update") + "</b>");
|
||||
//updateStatus("<b>" + _t("Checking for development build update") + "</b>");
|
||||
try {
|
||||
EepHead get = new EepHead(_context, proxyHost, proxyPort, 0, url);
|
||||
if (get.fetch()) {
|
||||
|
@@ -88,7 +88,7 @@ class UnsignedUpdateHandler implements Checker, Updater {
|
||||
return null;
|
||||
UpdateRunner update = new UnsignedUpdateRunner(_context, _mgr, updateSources);
|
||||
// set status before thread to ensure UI feedback
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._("Updating") + "</b>");
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._t("Updating") + "</b>");
|
||||
return update;
|
||||
}
|
||||
}
|
||||
|
@@ -38,7 +38,7 @@ class UnsignedUpdateRunner extends UpdateRunner {
|
||||
if (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
|
||||
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
|
||||
_context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
|
||||
String msg = _("HTTP client proxy tunnel must be running");
|
||||
String msg = _t("HTTP client proxy tunnel must be running");
|
||||
if (_log.shouldWarn())
|
||||
_log.warn(msg);
|
||||
updateStatus("<b>" + msg + "</b>");
|
||||
|
@@ -49,7 +49,7 @@ class UpdateHandler implements Updater {
|
||||
return null;
|
||||
UpdateRunner update = new UpdateRunner(_context, _mgr, type, method, updateSources);
|
||||
// set status before thread to ensure UI feedback
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._("Updating") + "</b>");
|
||||
_mgr.notifyProgress(update, "<b>" + _mgr._t("Updating") + "</b>");
|
||||
return update;
|
||||
}
|
||||
}
|
||||
|
@@ -152,7 +152,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
|
||||
if (proxyPort == ConfigUpdateHandler.DEFAULT_PROXY_PORT_INT &&
|
||||
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
|
||||
_context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0) {
|
||||
String msg = _("HTTP client proxy tunnel must be running");
|
||||
String msg = _t("HTTP client proxy tunnel must be running");
|
||||
if (_log.shouldWarn())
|
||||
_log.warn(msg);
|
||||
updateStatus("<b>" + msg + "</b>");
|
||||
@@ -199,7 +199,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
|
||||
continue;
|
||||
}
|
||||
|
||||
updateStatus("<b>" + _("Updating from {0}", linkify(updateURL)) + "</b>");
|
||||
updateStatus("<b>" + _t("Updating from {0}", linkify(updateURL)) + "</b>");
|
||||
if (_log.shouldLog(Log.DEBUG))
|
||||
_log.debug("Selected update URL: " + updateURL);
|
||||
|
||||
@@ -259,7 +259,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
|
||||
if (_isPartial)
|
||||
return;
|
||||
long d = currentWrite + bytesTransferred;
|
||||
String status = "<b>" + _("Updating") + "</b>";
|
||||
String status = "<b>" + _t("Updating") + "</b>";
|
||||
_mgr.notifyProgress(this, status, d, d + bytesRemaining);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
|
||||
if (newer) {
|
||||
_newVersion = newVersion;
|
||||
} else {
|
||||
updateStatus("<b>" + _("No new version found at {0}", linkify(url)) + "</b>");
|
||||
updateStatus("<b>" + _t("No new version found at {0}", linkify(url)) + "</b>");
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Found old version \"" + newVersion + "\" at " + url);
|
||||
}
|
||||
@@ -295,7 +295,7 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
|
||||
if (_log.shouldLog(Log.WARN))
|
||||
_log.warn("Update from " + url + " did not download completely (" +
|
||||
bytesRemaining + " remaining after " + currentAttempt + " tries)");
|
||||
updateStatus("<b>" + _("Transfer failed from {0}", linkify(url)) + "</b>");
|
||||
updateStatus("<b>" + _t("Transfer failed from {0}", linkify(url)) + "</b>");
|
||||
_mgr.notifyAttemptFailed(this, url, null);
|
||||
// update() will call notifyTaskFailed() after last URL
|
||||
}
|
||||
@@ -313,15 +313,15 @@ class UpdateRunner extends I2PAppThread implements UpdateTask, EepGet.StatusList
|
||||
}
|
||||
|
||||
/** translate a string */
|
||||
protected String _(String s) {
|
||||
return _mgr._(s);
|
||||
protected String _t(String s) {
|
||||
return _mgr._t(s);
|
||||
}
|
||||
|
||||
/**
|
||||
* translate a string with a parameter
|
||||
*/
|
||||
protected String _(String s, Object o) {
|
||||
return _mgr._(s, o);
|
||||
protected String _t(String s, Object o) {
|
||||
return _mgr._t(s, o);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -45,7 +45,7 @@ public class BanlistRenderer {
|
||||
|
||||
entries.putAll(_context.banlist().getEntries());
|
||||
if (entries.isEmpty()) {
|
||||
buf.append("<i>").append(_("none")).append("</i>");
|
||||
buf.append("<i>").append(_t("none")).append("</i>");
|
||||
out.write(buf.toString());
|
||||
return;
|
||||
}
|
||||
@@ -62,24 +62,24 @@ public class BanlistRenderer {
|
||||
buf.append(' ');
|
||||
String expireString = DataHelper.formatDuration2(expires);
|
||||
if (key.equals(Hash.FAKE_HASH))
|
||||
buf.append(_("Permanently banned"));
|
||||
buf.append(_t("Permanently banned"));
|
||||
else if (expires < 5l*24*60*60*1000)
|
||||
buf.append(_("Temporary ban expiring in {0}", expireString));
|
||||
buf.append(_t("Temporary ban expiring in {0}", expireString));
|
||||
else
|
||||
buf.append(_("Banned until restart or in {0}", expireString));
|
||||
buf.append(_t("Banned until restart or in {0}", expireString));
|
||||
Set<String> transports = entry.transports;
|
||||
if ( (transports != null) && (!transports.isEmpty()) )
|
||||
buf.append(" on the following transport: ").append(transports);
|
||||
if (entry.cause != null) {
|
||||
buf.append("<br>\n");
|
||||
if (entry.causeCode != null)
|
||||
buf.append(_(entry.cause, entry.causeCode));
|
||||
buf.append(_t(entry.cause, entry.causeCode));
|
||||
else
|
||||
buf.append(_(entry.cause));
|
||||
buf.append(_t(entry.cause));
|
||||
}
|
||||
if (!key.equals(Hash.FAKE_HASH)) {
|
||||
buf.append(" (<a href=\"configpeer?peer=").append(key.toBase64())
|
||||
.append("#unsh\">").append(_("unban now")).append("</a>)");
|
||||
.append("#unsh\">").append(_t("unban now")).append("</a>)");
|
||||
}
|
||||
buf.append("</li>\n");
|
||||
}
|
||||
@@ -89,23 +89,23 @@ public class BanlistRenderer {
|
||||
}
|
||||
|
||||
/** translate a string */
|
||||
private String _(String s) {
|
||||
private 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.
|
||||
*/
|
||||
private String _(String s, Object o) {
|
||||
private String _t(String s, Object o) {
|
||||
return Messages.getString(s, o, _context);
|
||||
}
|
||||
}
|
||||
|
@@ -146,9 +146,9 @@ public class CSSHelper extends HelperBase {
|
||||
public String title(String s) {
|
||||
StringBuilder buf = new StringBuilder(128);
|
||||
buf.append("<title>")
|
||||
.append(_("I2P Router Console"))
|
||||
.append(_t("I2P Router Console"))
|
||||
.append(" - ")
|
||||
.append(_(s))
|
||||
.append(_t(s))
|
||||
.append("</title>");
|
||||
return buf.toString();
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ public class ConfigAdvancedHandler extends FormHandler {
|
||||
} catch (IOException ioe) {
|
||||
_log.error("Config error", ioe);
|
||||
addFormError(ioe.toString());
|
||||
addFormError(_("Error updating the configuration - please see the error logs"));
|
||||
addFormError(_t("Error updating the configuration - please see the error logs"));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -69,9 +69,9 @@ public class ConfigAdvancedHandler extends FormHandler {
|
||||
|
||||
boolean saved = _context.router().saveConfig(props, unsetKeys);
|
||||
if (saved)
|
||||
addFormNotice(_("Configuration saved successfully"));
|
||||
addFormNotice(_t("Configuration saved successfully"));
|
||||
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 (_forceRestart) {
|
||||
// addFormNotice("Performing a soft restart");
|
||||
@@ -93,8 +93,8 @@ public class ConfigAdvancedHandler extends FormHandler {
|
||||
_context.router().rebuildRouterInfo();
|
||||
}
|
||||
if (saved)
|
||||
addFormNotice(_("Configuration saved successfully"));
|
||||
addFormNotice(_t("Configuration saved successfully"));
|
||||
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"));
|
||||
}
|
||||
}
|
||||
|
@@ -45,27 +45,27 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
_action = "Save Client Configuration";
|
||||
}
|
||||
|
||||
if (_action.equals(_("Save Client Configuration"))) {
|
||||
if (_action.equals(_t("Save Client Configuration"))) {
|
||||
saveClientChanges();
|
||||
return;
|
||||
}
|
||||
if (_action.equals(_("Save Interface Configuration"))) {
|
||||
if (_action.equals(_t("Save Interface Configuration"))) {
|
||||
saveInterfaceChanges();
|
||||
return;
|
||||
}
|
||||
if (_action.equals(_("Save WebApp Configuration"))) {
|
||||
if (_action.equals(_t("Save WebApp Configuration"))) {
|
||||
saveWebAppChanges();
|
||||
return;
|
||||
}
|
||||
boolean pluginsEnabled = PluginStarter.pluginsEnabled(_context);
|
||||
if (_action.equals(_("Save Plugin Configuration"))) {
|
||||
if (_action.equals(_t("Save Plugin Configuration"))) {
|
||||
if (pluginsEnabled)
|
||||
savePluginChanges();
|
||||
else
|
||||
addFormError("Plugins disabled");
|
||||
return;
|
||||
}
|
||||
if (_action.equals(_("Install Plugin"))) {
|
||||
if (_action.equals(_t("Install Plugin"))) {
|
||||
if (pluginsEnabled &&
|
||||
(_context.getBooleanPropertyDefaultTrue(ConfigClientsHelper.PROP_ENABLE_PLUGIN_INSTALL) ||
|
||||
isAdvanced()))
|
||||
@@ -74,7 +74,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
addFormError("Plugins disabled");
|
||||
return;
|
||||
}
|
||||
if (_action.equals(_("Install Plugin from File"))) {
|
||||
if (_action.equals(_t("Install Plugin from File"))) {
|
||||
if (pluginsEnabled &&
|
||||
(_context.getBooleanPropertyDefaultTrue(ConfigClientsHelper.PROP_ENABLE_PLUGIN_INSTALL) ||
|
||||
isAdvanced()))
|
||||
@@ -83,7 +83,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
addFormError("Plugins disabled");
|
||||
return;
|
||||
}
|
||||
if (_action.equals(_("Update All Installed Plugins"))) {
|
||||
if (_action.equals(_t("Update All Installed Plugins"))) {
|
||||
if (pluginsEnabled)
|
||||
updateAllPlugins();
|
||||
else
|
||||
@@ -135,14 +135,14 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
// I tried to check to see if the plugin was ran elsewhere,
|
||||
// and it sait it was when it was not. -- Sponge
|
||||
} catch (Throwable e) {
|
||||
addFormError(_("Error stopping plugin {0}", app) + ": " + e);
|
||||
addFormError(_t("Error stopping plugin {0}", app) + ": " + e);
|
||||
_log.error("Error stopping plugin " + app, e);
|
||||
}
|
||||
try {
|
||||
PluginStarter.deletePlugin(_context, app);
|
||||
addFormNotice(_("Deleted plugin {0}", app));
|
||||
addFormNotice(_t("Deleted plugin {0}", app));
|
||||
} catch (Throwable e) {
|
||||
addFormError(_("Error deleting plugin {0}", app) + ": " + e);
|
||||
addFormError(_t("Error deleting plugin {0}", app) + ": " + e);
|
||||
_log.error("Error deleting plugin " + app, e);
|
||||
}
|
||||
} else {
|
||||
@@ -167,17 +167,17 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
try {
|
||||
if (pluginsEnabled) {
|
||||
PluginStarter.stopPlugin(_context, app);
|
||||
addFormNotice(_("Stopped plugin {0}", app));
|
||||
addFormNotice(_t("Stopped plugin {0}", app));
|
||||
} else {
|
||||
addFormError("Plugins disabled");
|
||||
}
|
||||
} catch (Throwable e) {
|
||||
addFormError(_("Error stopping plugin {0}", app) + ": " + e);
|
||||
addFormError(_t("Error stopping plugin {0}", app) + ": " + e);
|
||||
_log.error("Error stopping plugin " + app, e);
|
||||
}
|
||||
} else {
|
||||
WebAppStarter.stopWebApp(app);
|
||||
addFormNotice(_("Stopped webapp {0}", app));
|
||||
addFormNotice(_t("Stopped webapp {0}", app));
|
||||
}
|
||||
}
|
||||
return;
|
||||
@@ -206,7 +206,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
}
|
||||
|
||||
// label (IE)
|
||||
String xStart = _("Start");
|
||||
String xStart = _t("Start");
|
||||
if (_action.toLowerCase(Locale.US).startsWith(xStart + "<span class=hide> ") &&
|
||||
_action.toLowerCase(Locale.US).endsWith("</span>")) {
|
||||
// IE sucks
|
||||
@@ -229,7 +229,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//addFormError(_("Unsupported") + ' ' + _action + '.');
|
||||
//addFormError(_t("Unsupported") + ' ' + _action + '.');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -279,13 +279,13 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
ClientAppConfig ca = new ClientAppConfig(clss, name, args, 2*60*1000,
|
||||
_settings.get(newClient + ".enabled") != null);
|
||||
clients.add(ca);
|
||||
addFormNotice(_("New client added") + ": " + name + " (" + clss + ").");
|
||||
addFormNotice(_t("New client added") + ": " + name + " (" + clss + ").");
|
||||
}
|
||||
}
|
||||
|
||||
ClientAppConfig.writeClientAppConfig(_context, clients);
|
||||
addFormNotice(_("Client configuration saved successfully"));
|
||||
//addFormNotice(_("Restart required to take effect"));
|
||||
addFormNotice(_t("Client configuration saved successfully"));
|
||||
//addFormNotice(_t("Restart required to take effect"));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -294,7 +294,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
private void stopClient(int i) {
|
||||
List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
|
||||
if (i >= clients.size()) {
|
||||
addFormError(_("Bad client index."));
|
||||
addFormError(_t("Bad client index."));
|
||||
return;
|
||||
}
|
||||
ClientAppConfig ca = clients.get(i);
|
||||
@@ -303,7 +303,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
try {
|
||||
// todo parseArgs(ca.stopArgs) ?
|
||||
clientApp.shutdown(null);
|
||||
addFormNotice(_("Client {0} stopped", ca.clientName));
|
||||
addFormNotice(_t("Client {0} stopped", ca.clientName));
|
||||
// Give a chance for status to update
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
@@ -320,12 +320,12 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
private void startClient(int i) {
|
||||
List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
|
||||
if (i >= clients.size()) {
|
||||
addFormError(_("Bad client index."));
|
||||
addFormError(_t("Bad client index."));
|
||||
return;
|
||||
}
|
||||
ClientAppConfig ca = clients.get(i);
|
||||
LoadClientAppsJob.runClient(ca.className, ca.clientName, LoadClientAppsJob.parseArgs(ca.args), _context, _log);
|
||||
addFormNotice(_("Client {0} started", ca.clientName));
|
||||
addFormNotice(_t("Client {0} started", ca.clientName));
|
||||
// Give a chance for status to update
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
@@ -335,12 +335,12 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
private void deleteClient(int i) {
|
||||
List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
|
||||
if (i < 0 || i >= clients.size()) {
|
||||
addFormError(_("Bad client index."));
|
||||
addFormError(_t("Bad client index."));
|
||||
return;
|
||||
}
|
||||
ClientAppConfig ca = clients.remove(i);
|
||||
ClientAppConfig.writeClientAppConfig(_context, clients);
|
||||
addFormNotice(_("Client {0} deleted", ca.clientName));
|
||||
addFormNotice(_t("Client {0} deleted", ca.clientName));
|
||||
}
|
||||
|
||||
private void saveWebAppChanges() {
|
||||
@@ -355,7 +355,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
props.setProperty(name, "" + (val != null));
|
||||
}
|
||||
RouterConsoleRunner.storeWebAppProperties(_context, props);
|
||||
addFormNotice(_("WebApp configuration saved."));
|
||||
addFormNotice(_t("WebApp configuration saved."));
|
||||
}
|
||||
|
||||
private void savePluginChanges() {
|
||||
@@ -369,7 +369,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
props.setProperty(name, "" + (val != null));
|
||||
}
|
||||
PluginStarter.storePluginProperties(props);
|
||||
addFormNotice(_("Plugin configuration saved."));
|
||||
addFormNotice(_t("Plugin configuration saved."));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -384,20 +384,20 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
File path = new File(_context.getBaseDir(), "webapps");
|
||||
path = new File(path, app + ".war");
|
||||
WebAppStarter.startWebApp(_context, s, app, path.getAbsolutePath());
|
||||
addFormNoticeNoEscape(_("WebApp") + " <a href=\"/" + app + "/\">" + _(app) + "</a> " + _("started") + '.');
|
||||
addFormNoticeNoEscape(_t("WebApp") + " <a href=\"/" + app + "/\">" + _t(app) + "</a> " + _t("started") + '.');
|
||||
} catch (Throwable e) {
|
||||
addFormError(_("Failed to start") + ' ' + _(app) + " " + e + '.');
|
||||
addFormError(_t("Failed to start") + ' ' + _t(app) + " " + e + '.');
|
||||
_log.error("Failed to start webapp " + app, e);
|
||||
}
|
||||
return;
|
||||
}
|
||||
addFormError(_("Failed to find server."));
|
||||
addFormError(_t("Failed to find server."));
|
||||
}
|
||||
|
||||
private void installPlugin() {
|
||||
String url = getJettyString("pluginURL");
|
||||
if (url == null || url.length() <= 0) {
|
||||
addFormError(_("No plugin URL specified."));
|
||||
addFormError(_t("No plugin URL specified."));
|
||||
return;
|
||||
}
|
||||
installPlugin(null, url);
|
||||
@@ -418,7 +418,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
try {
|
||||
// non-null but zero bytes if no file entered, don't know why
|
||||
if (in == null || in.available() <= 0) {
|
||||
addFormError(_("You must enter a file"));
|
||||
addFormError(_t("You must enter a file"));
|
||||
return;
|
||||
}
|
||||
DataHelper.read(in, magic);
|
||||
@@ -461,7 +461,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
if (status != null && status.length() > 0)
|
||||
addFormNoticeNoEscape(status);
|
||||
} catch (IOException ioe) {
|
||||
addFormError(_("Install from file failed") + " - " + ioe.getMessage());
|
||||
addFormError(_t("Install from file failed") + " - " + ioe.getMessage());
|
||||
} finally {
|
||||
// it's really a ByteArrayInputStream but we'll play along...
|
||||
if (in != null)
|
||||
@@ -476,7 +476,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
if (url == null)
|
||||
url = props.getProperty("updateURL");
|
||||
if (url == null) {
|
||||
addFormError(_("No update URL specified for {0}",app));
|
||||
addFormError(_t("No update URL specified for {0}",app));
|
||||
return;
|
||||
}
|
||||
installPlugin(app, url);
|
||||
@@ -485,12 +485,12 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
/** @since 0.8.13 */
|
||||
private void updateAllPlugins() {
|
||||
if (NewsHelper.isAnyUpdateInProgress()) {
|
||||
addFormError(_("Plugin or update download already in progress."));
|
||||
addFormError(_t("Plugin or update download already in progress."));
|
||||
return;
|
||||
}
|
||||
if (!verifyProxy())
|
||||
return;
|
||||
addFormNotice(_("Updating all plugins"));
|
||||
addFormNotice(_t("Updating all plugins"));
|
||||
PluginStarter.updateAll(_context);
|
||||
// So that update() will post a status to the summary bar before we reload
|
||||
try {
|
||||
@@ -509,14 +509,14 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
return;
|
||||
}
|
||||
if (mgr.isUpdateInProgress()) {
|
||||
addFormError(_("Plugin or update download already in progress."));
|
||||
addFormError(_t("Plugin or update download already in progress."));
|
||||
return;
|
||||
}
|
||||
URI uri;
|
||||
try {
|
||||
uri = new URI(url);
|
||||
} catch (URISyntaxException use) {
|
||||
addFormError(_("Bad URL {0}", url));
|
||||
addFormError(_t("Bad URL {0}", url));
|
||||
return;
|
||||
}
|
||||
if (!url.startsWith("file:")) {
|
||||
@@ -525,9 +525,9 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
}
|
||||
if (mgr.installPlugin(app, uri)) {
|
||||
if (url.startsWith("file:"))
|
||||
addFormNotice(_("Installing plugin from {0}", uri.getPath()));
|
||||
addFormNotice(_t("Installing plugin from {0}", uri.getPath()));
|
||||
else
|
||||
addFormNotice(_("Downloading plugin from {0}", url));
|
||||
addFormNotice(_t("Downloading plugin from {0}", url));
|
||||
} else {
|
||||
addFormError("Cannot install, check logs");
|
||||
}
|
||||
@@ -546,7 +546,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
if (!verifyProxy())
|
||||
return;
|
||||
mgr.check(PLUGIN, app);
|
||||
addFormNotice(_("Checking plugin {0} for updates", app));
|
||||
addFormNotice(_t("Checking plugin {0} for updates", app));
|
||||
// So that update() will post a status to the summary bar before we reload
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
@@ -570,16 +570,16 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
proxyHost.equals(ConfigUpdateHandler.DEFAULT_PROXY_HOST) &&
|
||||
_context.portMapper().getPort(PortMapper.SVC_HTTP_PROXY) < 0);
|
||||
if (!rv)
|
||||
addFormError(_("HTTP client proxy tunnel must be running"));
|
||||
addFormError(_t("HTTP client proxy tunnel must be running"));
|
||||
return rv;
|
||||
}
|
||||
|
||||
private void startPlugin(String app) {
|
||||
try {
|
||||
PluginStarter.startPlugin(_context, app);
|
||||
addFormNotice(_("Started plugin {0}", app));
|
||||
addFormNotice(_t("Started plugin {0}", app));
|
||||
} catch (Throwable e) {
|
||||
addFormError(_("Error starting plugin {0}", app) + ": " + e);
|
||||
addFormError(_t("Error starting plugin {0}", app) + ": " + e);
|
||||
_log.error("Error starting plugin " + app, e);
|
||||
}
|
||||
}
|
||||
@@ -601,7 +601,7 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
if (user != null && pw != null && user.length() > 0 && pw.length() > 0) {
|
||||
ConsolePasswordManager mgr = new ConsolePasswordManager(_context);
|
||||
mgr.saveHash(ConfigClientsHelper.PROP_AUTH, user, pw);
|
||||
addFormNotice(_("Added user {0}", user));
|
||||
addFormNotice(_t("Added user {0}", user));
|
||||
}
|
||||
String mode = getJettyString("mode");
|
||||
boolean disabled = "0".equals(mode);
|
||||
@@ -616,9 +616,9 @@ public class ConfigClientsHandler extends FormHandler {
|
||||
"::".equals(intfc);
|
||||
changes.put(ConfigClientsHelper.BIND_ALL_INTERFACES, Boolean.toString(all));
|
||||
if (_context.router().saveConfig(changes, null)) {
|
||||
addFormNotice(_("Interface configuration saved"));
|
||||
addFormNotice(_("Restart required to take effect"));
|
||||
addFormNotice(_t("Interface configuration saved"));
|
||||
addFormNotice(_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"));
|
||||
}
|
||||
}
|
||||
|
@@ -95,7 +95,7 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
public void setEdit(String edit) {
|
||||
if (edit == null)
|
||||
return;
|
||||
String xStart = _("Edit");
|
||||
String xStart = _t("Edit");
|
||||
if (edit.startsWith(xStart + "<span class=hide> ") &&
|
||||
edit.endsWith("</span>")) {
|
||||
// IE sucks
|
||||
@@ -104,7 +104,7 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
_edit = edit.substring(5);
|
||||
} else if (edit.startsWith(xStart + ' ')) {
|
||||
_edit = edit.substring(xStart.length() + 1);
|
||||
} else if ((_("Add Client")).equals(edit)) {
|
||||
} else if ((_t("Add Client")).equals(edit)) {
|
||||
_edit = "new";
|
||||
}
|
||||
}
|
||||
@@ -113,10 +113,10 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
public String getForm1() {
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<table>\n" +
|
||||
"<tr><th align=\"right\">").append(_("Client")).append("</th><th>")
|
||||
.append(_("Run at Startup?")).append("</th><th>")
|
||||
.append(_("Control")).append("</th><th align=\"left\">")
|
||||
.append(_("Class and arguments")).append("</th></tr>\n");
|
||||
"<tr><th align=\"right\">").append(_t("Client")).append("</th><th>")
|
||||
.append(_t("Run at Startup?")).append("</th><th>")
|
||||
.append(_t("Control")).append("</th><th align=\"left\">")
|
||||
.append(_t("Class and arguments")).append("</th></tr>\n");
|
||||
|
||||
boolean allowEdit = isClientChangeEnabled();
|
||||
List<ClientAppConfig> clients = ClientAppConfig.getClientApps(_context);
|
||||
@@ -125,7 +125,7 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
ClientAppConfig ca = clients.get(cur);
|
||||
String xname = ca.clientName;
|
||||
if (xname.length() > 0)
|
||||
xname = _(xname);
|
||||
xname = _t(xname);
|
||||
cacs.add(new CAC(cur, ca, xname));
|
||||
}
|
||||
Collections.sort(cacs, new CACComparator());
|
||||
@@ -199,10 +199,10 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
public String getForm2() {
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<table>\n" +
|
||||
"<tr><th align=\"right\">").append(_("WebApp")).append("</th><th>")
|
||||
.append(_("Run at Startup?")).append("</th><th>")
|
||||
.append(_("Control")).append("</th><th align=\"left\">")
|
||||
.append(_("Description")).append("</th></tr>\n");
|
||||
"<tr><th align=\"right\">").append(_t("WebApp")).append("</th><th>")
|
||||
.append(_t("Run at Startup?")).append("</th><th>")
|
||||
.append(_t("Control")).append("</th><th align=\"left\">")
|
||||
.append(_t("Description")).append("</th></tr>\n");
|
||||
Properties props = RouterConsoleRunner.webAppProperties(_context);
|
||||
Set<String> keys = new TreeSet<String>(props.stringPropertyNames());
|
||||
for (String name : keys) {
|
||||
@@ -228,10 +228,10 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
public String getForm3() {
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<table>\n" +
|
||||
"<tr><th align=\"right\">").append(_("Plugin")).append("</th><th>")
|
||||
.append(_("Run at Startup?")).append("</th><th>")
|
||||
.append(_("Control")).append("</th><th align=\"left\">")
|
||||
.append(_("Description")).append("</th></tr>\n");
|
||||
"<tr><th align=\"right\">").append(_t("Plugin")).append("</th><th>")
|
||||
.append(_t("Run at Startup?")).append("</th><th>")
|
||||
.append(_t("Control")).append("</th><th align=\"left\">")
|
||||
.append(_t("Description")).append("</th></tr>\n");
|
||||
Properties props = PluginStarter.pluginProperties();
|
||||
Set<String> keys = new TreeSet<String>(props.stringPropertyNames());
|
||||
for (String name : keys) {
|
||||
@@ -245,9 +245,9 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
continue;
|
||||
StringBuilder desc = new StringBuilder(256);
|
||||
desc.append("<table border=\"0\">")
|
||||
.append("<tr><td><b>").append(_("Version")).append("</b></td><td>").append(stripHTML(appProps, "version"))
|
||||
.append("<tr><td><b>").append(_t("Version")).append("</b></td><td>").append(stripHTML(appProps, "version"))
|
||||
.append("<tr><td><b>")
|
||||
.append(_("Signed by")).append("</b></td><td>");
|
||||
.append(_t("Signed by")).append("</b></td><td>");
|
||||
String s = stripHTML(appProps, "signer");
|
||||
if (s != null) {
|
||||
if (s.indexOf("@") > 0)
|
||||
@@ -264,13 +264,13 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
if (ms > 0) {
|
||||
String date = (new SimpleDateFormat("yyyy-MM-dd HH:mm")).format(new Date(ms));
|
||||
desc.append("<tr><td><b>")
|
||||
.append(_("Date")).append("</b></td><td>").append(date);
|
||||
.append(_t("Date")).append("</b></td><td>").append(date);
|
||||
}
|
||||
}
|
||||
s = stripHTML(appProps, "author");
|
||||
if (s != null) {
|
||||
desc.append("<tr><td><b>")
|
||||
.append(_("Author")).append("</b></td><td>");
|
||||
.append(_t("Author")).append("</b></td><td>");
|
||||
if (s.indexOf("@") > 0)
|
||||
desc.append("<a href=\"mailto:").append(s).append("\">").append(s).append("</a>");
|
||||
else
|
||||
@@ -281,24 +281,24 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
s = stripHTML(appProps, "description");
|
||||
if (s != null) {
|
||||
desc.append("<tr><td><b>")
|
||||
.append(_("Description")).append("</b></td><td>").append(s);
|
||||
.append(_t("Description")).append("</b></td><td>").append(s);
|
||||
}
|
||||
s = stripHTML(appProps, "license");
|
||||
if (s != null) {
|
||||
desc.append("<tr><td><b>")
|
||||
.append(_("License")).append("</b></td><td>").append(s);
|
||||
.append(_t("License")).append("</b></td><td>").append(s);
|
||||
}
|
||||
s = stripHTML(appProps, "websiteURL");
|
||||
if (s != null) {
|
||||
desc.append("<tr><td>")
|
||||
.append("<a href=\"").append(s).append("\">").append(_("Website")).append("</a><td> ");
|
||||
.append("<a href=\"").append(s).append("\">").append(_t("Website")).append("</a><td> ");
|
||||
}
|
||||
String updateURL = stripHTML(appProps, "updateURL.su3");
|
||||
if (updateURL == null)
|
||||
updateURL = stripHTML(appProps, "updateURL");
|
||||
if (updateURL != null) {
|
||||
desc.append("<tr><td>")
|
||||
.append("<a href=\"").append(updateURL).append("\">").append(_("Update link")).append("</a><td> ");
|
||||
.append("<a href=\"").append(updateURL).append("\">").append(_t("Update link")).append("</a><td> ");
|
||||
}
|
||||
desc.append("</table>");
|
||||
boolean isRunning = PluginStarter.isPluginRunning(app, _context);
|
||||
@@ -328,15 +328,15 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
String link = "/";
|
||||
if (! RouterConsoleRunner.ROUTERCONSOLE.equals(name))
|
||||
link += name + "/";
|
||||
buf.append("<a href=\"").append(link).append("\">").append(_(name)).append("</a>");
|
||||
buf.append("<a href=\"").append(link).append("\">").append(_t(name)).append("</a>");
|
||||
} else if (edit && !ro) {
|
||||
buf.append("<input type=\"text\" name=\"name").append(index).append("\" value=\"");
|
||||
if (name.length() > 0)
|
||||
buf.append(_(name));
|
||||
buf.append(_t(name));
|
||||
buf.append("\" >");
|
||||
} else {
|
||||
if (name.length() > 0)
|
||||
buf.append(_(name));
|
||||
buf.append(_t(name));
|
||||
}
|
||||
buf.append("</td><td align=\"center\" width=\"10%\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\" value=\"true\" ");
|
||||
if (enabled) {
|
||||
@@ -349,26 +349,26 @@ public class ConfigClientsHelper extends HelperBase {
|
||||
// remove if you wnat to put them back
|
||||
if (showStartButton && (!ro) && !edit) {
|
||||
buf.append("<button type=\"submit\" class=\"Xaccept\" name=\"action\" value=\"Start ").append(index).append("\" >")
|
||||
.append(_("Start")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
.append(_t("Start")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
}
|
||||
if (showStopButton && (!edit))
|
||||
buf.append("<button type=\"submit\" class=\"Xstop\" name=\"action\" value=\"Stop ").append(index).append("\" >")
|
||||
.append(_("Stop")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
.append(_t("Stop")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
if (isClientChangeEnabled() && showEditButton && (!edit) && !ro)
|
||||
buf.append("<button type=\"submit\" class=\"Xadd\" name=\"edit\" value=\"Edit ").append(index).append("\" >")
|
||||
.append(_("Edit")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
.append(_t("Edit")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
if (showUpdateButton && (!edit) && !ro) {
|
||||
buf.append("<button type=\"submit\" class=\"Xcheck\" name=\"action\" value=\"Check ").append(index).append("\" >")
|
||||
.append(_("Check for updates")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
.append(_t("Check for updates")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
buf.append("<button type=\"submit\" class=\"Xdownload\" name=\"action\" value=\"Update ").append(index).append("\" >")
|
||||
.append(_("Update")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
.append(_t("Update")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
}
|
||||
if (showDeleteButton && (!edit) && !ro) {
|
||||
buf.append("<button type=\"submit\" class=\"Xdelete\" name=\"action\" value=\"Delete ").append(index)
|
||||
.append("\" onclick=\"if (!confirm('")
|
||||
.append(_("Are you sure you want to delete {0}?", _(name)))
|
||||
.append(_t("Are you sure you want to delete {0}?", _t(name)))
|
||||
.append("')) { return false; }\">")
|
||||
.append(_("Delete")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
.append(_t("Delete")).append("<span class=hide> ").append(index).append("</span></button>");
|
||||
}
|
||||
buf.append("</td><td align=\"left\" width=\"50%\">");
|
||||
if (edit && !ro) {
|
||||
|
@@ -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<String> toDelete = new HashSet<String>();
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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");
|
||||
}
|
||||
|
@@ -42,9 +42,9 @@ public class ConfigLoggingHelper extends HelperBase {
|
||||
buf.append(prefix).append('=').append(level).append('\n');
|
||||
}
|
||||
buf.append("</textarea><br>\n");
|
||||
buf.append("<i>").append(_("Add additional logging statements above. Example: net.i2p.router.tunnel=WARN")).append("</i><br>");
|
||||
buf.append("<i>").append(_("Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN")).append("</i><br>");
|
||||
buf.append("<i>").append(_("Valid levels are DEBUG, INFO, WARN, ERROR, CRIT")).append("</i>\n");
|
||||
buf.append("<i>").append(_t("Add additional logging statements above. Example: net.i2p.router.tunnel=WARN")).append("</i><br>");
|
||||
buf.append("<i>").append(_t("Or put entries in the logger.config file. Example: logger.record.net.i2p.router.tunnel=WARN")).append("</i><br>");
|
||||
buf.append("<i>").append(_t("Valid levels are DEBUG, INFO, WARN, ERROR, CRIT")).append("</i>\n");
|
||||
|
||||
/****
|
||||
// this is too big and ugly
|
||||
@@ -78,11 +78,11 @@ public class ConfigLoggingHelper extends HelperBase {
|
||||
buf.append("<option value=\"").append(l).append('\"');
|
||||
if (l.equals(cur))
|
||||
buf.append(" selected=\"selected\"");
|
||||
buf.append('>').append(_(l)).append("</option>\n");
|
||||
buf.append('>').append(_t(l)).append("</option>\n");
|
||||
}
|
||||
|
||||
if (showRemove)
|
||||
buf.append("<option value=\"remove\">").append(_("Remove")).append("</option>");
|
||||
buf.append("<option value=\"remove\">").append(_t("Remove")).append("</option>");
|
||||
buf.append("</select>\n");
|
||||
return buf.toString();
|
||||
}
|
||||
@@ -119,7 +119,7 @@ public class ConfigLoggingHelper extends HelperBase {
|
||||
StringBuilder buf = new StringBuilder(65536);
|
||||
buf.append("<select name=\"newlogclass\">\n" +
|
||||
"<option value=\"\" selected=\"selected\">")
|
||||
.append(_("Select a class to add"))
|
||||
.append(_t("Select a class to add"))
|
||||
.append("</option>\n");
|
||||
|
||||
for (String l : sortedLogs) {
|
||||
|
@@ -62,7 +62,7 @@ public class ConfigNavHelper extends HelperBase {
|
||||
buf.append("<center>");
|
||||
List<Tab> tabs = new ArrayList<Tab>(pages.length);
|
||||
for (int i = 0; i < pages.length; i++) {
|
||||
tabs.add(new Tab(pages[i], _(titles[i])));
|
||||
tabs.add(new Tab(pages[i], _t(titles[i])));
|
||||
}
|
||||
Collections.sort(tabs, new TabComparator());
|
||||
for (int i = 0; i < tabs.size(); i++) {
|
||||
|
@@ -56,7 +56,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
|
||||
@Override
|
||||
protected void processForm() {
|
||||
if (_saveRequested || ( (_action != null) && (_("Save changes").equals(_action)) )) {
|
||||
if (_saveRequested || ( (_action != null) && (_t("Save changes").equals(_action)) )) {
|
||||
saveChanges();
|
||||
//} else if (_recheckReachabilityRequested) {
|
||||
// recheckReachability();
|
||||
@@ -145,7 +145,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
/****
|
||||
private void recheckReachability() {
|
||||
_context.commSystem().recheckReachability();
|
||||
addFormNotice(_("Rechecking router reachability..."));
|
||||
addFormNotice(_t("Rechecking router reachability..."));
|
||||
}
|
||||
****/
|
||||
|
||||
@@ -209,7 +209,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
}
|
||||
changes.put(UDPTransport.PROP_SOURCES, _udpAutoIP);
|
||||
if ((!oldUdp.equals(_udpAutoIP)) || (!oldUHost.equals(uhost))) {
|
||||
addFormNotice(_("Updating IP address"));
|
||||
addFormNotice(_t("Updating IP address"));
|
||||
restartRequired = true;
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
ch = true;
|
||||
}
|
||||
if (ch)
|
||||
addFormNotice(_("Updating IPv6 setting"));
|
||||
addFormNotice(_t("Updating IPv6 setting"));
|
||||
}
|
||||
|
||||
// NTCP Settings
|
||||
@@ -248,21 +248,21 @@ public class ConfigNetHandler extends FormHandler {
|
||||
if ((!oldAutoHost.equals(_ntcpAutoIP)) || ! oldNHost.equalsIgnoreCase(_ntcpHostname)) {
|
||||
boolean valid = true;
|
||||
if ("disabled".equals(_ntcpAutoIP)) {
|
||||
addFormNotice(_("Disabling TCP completely"));
|
||||
addFormNotice(_t("Disabling TCP completely"));
|
||||
} else if ("false".equals(_ntcpAutoIP) && _ntcpHostname.length() > 0) {
|
||||
valid = verifyAddress(_ntcpHostname);
|
||||
if (valid) {
|
||||
changes.put(ConfigNetHelper.PROP_I2NP_NTCP_HOSTNAME, _ntcpHostname);
|
||||
addFormNotice(_("Updating TCP address to {0}", _ntcpHostname));
|
||||
addFormNotice(_t("Updating TCP address to {0}", _ntcpHostname));
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
} else {
|
||||
removes.add(ConfigNetHelper.PROP_I2NP_NTCP_HOSTNAME);
|
||||
if ("false".equals(_ntcpAutoIP))
|
||||
addFormNotice(_("Disabling inbound TCP"));
|
||||
addFormNotice(_t("Disabling inbound TCP"));
|
||||
else
|
||||
addFormNotice(_("Updating inbound TCP address to auto")); // true or always
|
||||
addFormNotice(_t("Updating inbound TCP address to auto")); // true or always
|
||||
}
|
||||
if (valid) {
|
||||
changes.put(ConfigNetHelper.PROP_I2NP_NTCP_AUTO_IP, _ntcpAutoIP);
|
||||
@@ -275,18 +275,18 @@ public class ConfigNetHandler extends FormHandler {
|
||||
int port = Addresses.getPort(_ntcpPort);
|
||||
if (port != 0) {
|
||||
changes.put(ConfigNetHelper.PROP_I2NP_NTCP_PORT, _ntcpPort);
|
||||
addFormNotice(_("Updating TCP port to {0}", _ntcpPort));
|
||||
addFormNotice(_t("Updating TCP port to {0}", _ntcpPort));
|
||||
if (port < 1024) {
|
||||
addFormError(_("Warning - ports less than 1024 are not recommended"));
|
||||
addFormError(_t("Warning - ports less than 1024 are not recommended"));
|
||||
error = true;
|
||||
}
|
||||
} else {
|
||||
addFormError(_("Invalid port") + ": " + _ntcpPort);
|
||||
addFormError(_t("Invalid port") + ": " + _ntcpPort);
|
||||
error = true;
|
||||
}
|
||||
} else {
|
||||
removes.add(ConfigNetHelper.PROP_I2NP_NTCP_PORT);
|
||||
addFormNotice(_("Updating inbound TCP port to auto"));
|
||||
addFormNotice(_t("Updating inbound TCP port to auto"));
|
||||
}
|
||||
changes.put(ConfigNetHelper.PROP_I2NP_NTCP_AUTO_PORT, "" + _ntcpAutoPort);
|
||||
restartRequired = true;
|
||||
@@ -300,15 +300,15 @@ public class ConfigNetHandler extends FormHandler {
|
||||
if (port != 0) {
|
||||
changes.put(UDPTransport.PROP_INTERNAL_PORT, _udpPort);
|
||||
changes.put(UDPTransport.PROP_EXTERNAL_PORT, _udpPort);
|
||||
addFormNotice(_("Updating UDP port to {0}", _udpPort));
|
||||
addFormNotice(_t("Updating UDP port to {0}", _udpPort));
|
||||
if (port < 1024) {
|
||||
addFormError(_("Warning - ports less than 1024 are not recommended"));
|
||||
addFormError(_t("Warning - ports less than 1024 are not recommended"));
|
||||
error = true;
|
||||
} else {
|
||||
restartRequired = true;
|
||||
}
|
||||
} else {
|
||||
addFormError(_("Invalid port") + ": " + _udpPort);
|
||||
addFormError(_t("Invalid port") + ": " + _udpPort);
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
@@ -325,9 +325,9 @@ public class ConfigNetHandler extends FormHandler {
|
||||
if (switchRequired) {
|
||||
changes.put(PROP_HIDDEN, "" + _hiddenMode);
|
||||
if (_hiddenMode)
|
||||
addFormError(_("Gracefully restarting into Hidden Router Mode"));
|
||||
addFormError(_t("Gracefully restarting into Hidden Router Mode"));
|
||||
else
|
||||
addFormError(_("Gracefully restarting to exit Hidden Router Mode"));
|
||||
addFormError(_t("Gracefully restarting to exit Hidden Router Mode"));
|
||||
}
|
||||
|
||||
changes.put(Router.PROP_DYNAMIC_KEYS, "" + _dynamicKeys);
|
||||
@@ -336,10 +336,10 @@ public class ConfigNetHandler extends FormHandler {
|
||||
_upnp) {
|
||||
// This is minor, don't set restartRequired
|
||||
if (_upnp)
|
||||
addFormNotice(_("Enabling UPnP"));
|
||||
addFormNotice(_t("Enabling UPnP"));
|
||||
else
|
||||
addFormNotice(_("Disabling UPnP"));
|
||||
addFormNotice(_("Restart required to take effect"));
|
||||
addFormNotice(_t("Disabling UPnP"));
|
||||
addFormNotice(_t("Restart required to take effect"));
|
||||
}
|
||||
changes.put(TransportManager.PROP_ENABLE_UPNP, "" + _upnp);
|
||||
|
||||
@@ -347,18 +347,18 @@ public class ConfigNetHandler extends FormHandler {
|
||||
_laptop) {
|
||||
// This is minor, don't set restartRequired
|
||||
if (_laptop)
|
||||
addFormNotice(_("Enabling laptop mode"));
|
||||
addFormNotice(_t("Enabling laptop mode"));
|
||||
else
|
||||
addFormNotice(_("Disabling laptop mode"));
|
||||
addFormNotice(_t("Disabling laptop mode"));
|
||||
}
|
||||
changes.put(UDPTransport.PROP_LAPTOP_MODE, "" + _laptop);
|
||||
|
||||
if (Boolean.parseBoolean(_context.getProperty(TransportUtil.PROP_IPV4_FIREWALLED)) !=
|
||||
_ipv4Firewalled) {
|
||||
if (_ipv4Firewalled)
|
||||
addFormNotice(_("Disabling inbound IPv4"));
|
||||
addFormNotice(_t("Disabling inbound IPv4"));
|
||||
else
|
||||
addFormNotice(_("Enabling inbound IPv4"));
|
||||
addFormNotice(_t("Enabling inbound IPv4"));
|
||||
restartRequired = true;
|
||||
}
|
||||
changes.put(TransportUtil.PROP_IPV4_FIREWALLED, "" + _ipv4Firewalled);
|
||||
@@ -366,16 +366,16 @@ public class ConfigNetHandler extends FormHandler {
|
||||
if (_context.getBooleanPropertyDefaultTrue(TransportManager.PROP_ENABLE_UDP) !=
|
||||
!_udpDisabled) {
|
||||
if (_udpDisabled)
|
||||
addFormNotice(_("Disabling UDP"));
|
||||
addFormNotice(_t("Disabling UDP"));
|
||||
else
|
||||
addFormNotice(_("Enabling UDP"));
|
||||
addFormNotice(_t("Enabling UDP"));
|
||||
restartRequired = true;
|
||||
}
|
||||
changes.put(TransportManager.PROP_ENABLE_UDP, "" + (!_udpDisabled));
|
||||
|
||||
if (_requireIntroductions) {
|
||||
changes.put(UDPTransport.PROP_FORCE_INTRODUCERS, "true");
|
||||
addFormNotice(_("Requiring SSU introducers"));
|
||||
addFormNotice(_t("Requiring SSU introducers"));
|
||||
} else {
|
||||
removes.add(UDPTransport.PROP_FORCE_INTRODUCERS);
|
||||
}
|
||||
@@ -386,9 +386,9 @@ public class ConfigNetHandler extends FormHandler {
|
||||
|
||||
boolean saved = _context.router().saveConfig(changes, removes);
|
||||
if (saved)
|
||||
addFormNotice(_("Configuration saved successfully"));
|
||||
addFormNotice(_t("Configuration saved successfully"));
|
||||
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"));
|
||||
|
||||
// this has to be after the save
|
||||
if (ratesUpdated)
|
||||
@@ -416,7 +416,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
//} else {
|
||||
// There's a few changes that don't really require restart (e.g. enabling inbound TCP)
|
||||
// But it would be hard to get right, so just do a restart.
|
||||
//addFormError(_("Gracefully restarting I2P to change published router address"));
|
||||
//addFormError(_t("Gracefully restarting I2P to change published router address"));
|
||||
//_context.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
|
||||
//}
|
||||
}
|
||||
@@ -433,13 +433,13 @@ public class ConfigNetHandler extends FormHandler {
|
||||
return false;
|
||||
byte[] iab = Addresses.getIP(addr);
|
||||
if (iab == null) {
|
||||
addFormError(_("Invalid address") + ": " + addr);
|
||||
addFormError(_t("Invalid address") + ": " + addr);
|
||||
return false;
|
||||
}
|
||||
// TODO set IPv6 arg based on configuration?
|
||||
boolean rv = TransportUtil.isPubliclyRoutable(iab, true);
|
||||
if (!rv)
|
||||
addFormError(_("The hostname or IP {0} is not publicly routable", addr));
|
||||
addFormError(_t("The hostname or IP {0} is not publicly routable", addr));
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -464,7 +464,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
String old = _context.router().getConfigSetting(Router.PROP_BANDWIDTH_SHARE_PERCENTAGE);
|
||||
if ( (old == null) || (!old.equals(_sharePct)) ) {
|
||||
changes.put(Router.PROP_BANDWIDTH_SHARE_PERCENTAGE, _sharePct);
|
||||
addFormNotice(_("Updating bandwidth share percentage"));
|
||||
addFormNotice(_t("Updating bandwidth share percentage"));
|
||||
updated = true;
|
||||
}
|
||||
}
|
||||
@@ -494,7 +494,7 @@ public class ConfigNetHandler extends FormHandler {
|
||||
}
|
||||
|
||||
if (bwUpdated) {
|
||||
addFormNotice(_("Updated bandwidth limits"));
|
||||
addFormNotice(_t("Updated bandwidth limits"));
|
||||
updated = true;
|
||||
}
|
||||
|
||||
|
@@ -43,10 +43,10 @@ public class ConfigNetHelper extends HelperBase {
|
||||
public String getUdpIP() {
|
||||
RouterAddress addr = _context.router().getRouterInfo().getTargetAddress("SSU");
|
||||
if (addr == null)
|
||||
return _("unknown");
|
||||
return _t("unknown");
|
||||
String rv = addr.getHost();
|
||||
if (rv == null)
|
||||
return _("unknown");
|
||||
return _t("unknown");
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -58,10 +58,10 @@ public class ConfigNetHelper extends HelperBase {
|
||||
/****
|
||||
RouterAddress addr = _context.router().getRouterInfo().getTargetAddress("SSU");
|
||||
if (addr == null)
|
||||
return _("unknown");
|
||||
return _t("unknown");
|
||||
UDPAddress ua = new UDPAddress(addr);
|
||||
if (ua.getPort() <= 0)
|
||||
return _("unknown");
|
||||
return _t("unknown");
|
||||
return "" + ua.getPort();
|
||||
****/
|
||||
// Since we can't get to UDPTransport.getRequestedPort() from here, just use
|
||||
@@ -253,8 +253,8 @@ public class ConfigNetHelper extends HelperBase {
|
||||
return kbytesToBits(getShareBandwidth());
|
||||
}
|
||||
private String kbytesToBits(int kbytes) {
|
||||
return DataHelper.formatSize(kbytes * (8 * 1024L)) + ' ' + _("bits per second") +
|
||||
' ' + _("or {0} bytes per month maximum", DataHelper.formatSize(kbytes * (1024L * 60 * 60 * 24 * 31)));
|
||||
return DataHelper.formatSize(kbytes * (8 * 1024L)) + ' ' + _t("bits per second") +
|
||||
' ' + _t("or {0} bytes per month maximum", DataHelper.formatSize(kbytes * (1024L * 60 * 60 * 24 * 31)));
|
||||
}
|
||||
public String getInboundBurstRate() {
|
||||
return "" + _context.bandwidthLimiter().getInboundBurstKBytesPerSecond();
|
||||
|
@@ -17,26 +17,26 @@ public class ConfigPeerHandler extends FormHandler {
|
||||
if ("Save Configuration".equals(_action)) {
|
||||
_context.router().saveConfig();
|
||||
addFormNotice("Settings saved - not really!!!!!");
|
||||
} else if (_action.equals(_("Ban peer until restart"))) {
|
||||
} else if (_action.equals(_t("Ban peer until restart"))) {
|
||||
Hash h = getHash();
|
||||
if (h != null) {
|
||||
_context.banlist().banlistRouterForever(h, _("Manually banned via {0}"), "<a href=\"configpeer\">configpeer</a>");
|
||||
addFormNotice(_("Peer") + " " + _peer + " " + _("banned until restart") );
|
||||
_context.banlist().banlistRouterForever(h, _t("Manually banned via {0}"), "<a href=\"configpeer\">configpeer</a>");
|
||||
addFormNotice(_t("Peer") + " " + _peer + " " + _t("banned until restart") );
|
||||
return;
|
||||
}
|
||||
addFormError(_("Invalid peer"));
|
||||
} else if (_action.equals(_("Unban peer"))) {
|
||||
addFormError(_t("Invalid peer"));
|
||||
} else if (_action.equals(_t("Unban peer"))) {
|
||||
Hash h = getHash();
|
||||
if (h != null) {
|
||||
if (_context.banlist().isBanlisted(h)) {
|
||||
_context.banlist().unbanlistRouter(h);
|
||||
addFormNotice(_("Peer") + " " + _peer + " " + _("unbanned") );
|
||||
addFormNotice(_t("Peer") + " " + _peer + " " + _t("unbanned") );
|
||||
} else
|
||||
addFormNotice(_("Peer") + " " + _peer + " " + _("is not currently banned") );
|
||||
addFormNotice(_t("Peer") + " " + _peer + " " + _t("is not currently banned") );
|
||||
return;
|
||||
}
|
||||
addFormError(_("Invalid peer"));
|
||||
} else if (_action.equals(_("Adjust peer bonuses"))) {
|
||||
addFormError(_t("Invalid peer"));
|
||||
} else if (_action.equals(_t("Adjust peer bonuses"))) {
|
||||
Hash h = getHash();
|
||||
if (h != null) {
|
||||
PeerProfile prof = _context.profileOrganizer().getProfile(h);
|
||||
@@ -44,23 +44,23 @@ public class ConfigPeerHandler extends FormHandler {
|
||||
try {
|
||||
prof.setSpeedBonus(Long.parseLong(_speed));
|
||||
} catch (NumberFormatException nfe) {
|
||||
addFormError(_("Bad speed value"));
|
||||
addFormError(_t("Bad speed value"));
|
||||
}
|
||||
try {
|
||||
prof.setCapacityBonus(Long.parseLong(_capacity));
|
||||
} catch (NumberFormatException nfe) {
|
||||
addFormError(_("Bad capacity value"));
|
||||
addFormError(_t("Bad capacity value"));
|
||||
}
|
||||
addFormNotice("Bonuses adjusted for " + _peer);
|
||||
} else
|
||||
addFormError("No profile exists for " + _peer);
|
||||
return;
|
||||
}
|
||||
addFormError(_("Invalid peer"));
|
||||
addFormError(_t("Invalid peer"));
|
||||
} else if (_action.startsWith("Check")) {
|
||||
addFormError(_("Unsupported"));
|
||||
addFormError(_t("Unsupported"));
|
||||
} else {
|
||||
//addFormError(_("Unsupported") + ' ' + _action + '.');
|
||||
//addFormError(_t("Unsupported") + ' ' + _action + '.');
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -21,32 +21,32 @@ public class ConfigReseedHandler extends FormHandler {
|
||||
@Override
|
||||
protected void processForm() {
|
||||
|
||||
if (_action.equals(_("Save changes and reseed now"))) {
|
||||
if (_action.equals(_t("Save changes and reseed now"))) {
|
||||
saveChanges();
|
||||
if (!_context.netDb().reseedChecker().requestReseed()) {
|
||||
addFormError(_("Reseeding is already in progress"));
|
||||
addFormError(_t("Reseeding is already in progress"));
|
||||
} else {
|
||||
// skip the nonce checking in ReseedHandler
|
||||
addFormNotice(_("Starting reseed process"));
|
||||
addFormNotice(_t("Starting reseed process"));
|
||||
}
|
||||
} else if (_action.equals(_("Reseed from URL"))) {
|
||||
} else if (_action.equals(_t("Reseed from URL"))) {
|
||||
String val = getJettyString("url");
|
||||
if (val != null)
|
||||
val = val.trim();
|
||||
if (val == null || val.length() == 0) {
|
||||
addFormError(_("You must enter a URL"));
|
||||
addFormError(_t("You must enter a URL"));
|
||||
return;
|
||||
}
|
||||
URL url;
|
||||
try {
|
||||
url = new URL(val);
|
||||
} catch (MalformedURLException mue) {
|
||||
addFormError(_("Bad URL {0}", val));
|
||||
addFormError(_t("Bad URL {0}", val));
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (!_context.netDb().reseedChecker().requestReseed(url)) {
|
||||
addFormError(_("Reseeding is already in progress"));
|
||||
addFormError(_t("Reseeding is already in progress"));
|
||||
} else {
|
||||
// wait a while for completion but not forever
|
||||
for (int i = 0; i < 40; i++) {
|
||||
@@ -63,50 +63,50 @@ public class ConfigReseedHandler extends FormHandler {
|
||||
} else if (status.length() > 0) {
|
||||
addFormNoticeNoEscape(status);
|
||||
} else if (_context.netDb().reseedChecker().inProgress()) {
|
||||
addFormNotice(_("Reseed in progress, check summary bar for status"));
|
||||
addFormNotice(_t("Reseed in progress, check summary bar for status"));
|
||||
} else {
|
||||
addFormNotice(_("Reseed complete, check summary bar for status"));
|
||||
addFormNotice(_t("Reseed complete, check summary bar for status"));
|
||||
}
|
||||
}
|
||||
} catch (IllegalArgumentException iae) {
|
||||
addFormError(_("Bad URL {0}", val) + " - " + iae.getMessage());
|
||||
addFormError(_t("Bad URL {0}", val) + " - " + iae.getMessage());
|
||||
}
|
||||
} else if (_action.equals(_("Reseed from file"))) {
|
||||
} else if (_action.equals(_t("Reseed from file"))) {
|
||||
InputStream in = _requestWrapper.getInputStream("file");
|
||||
try {
|
||||
// non-null but zero bytes if no file entered, don't know why
|
||||
if (in == null || in.available() <= 0) {
|
||||
addFormError(_("You must enter a file"));
|
||||
addFormError(_t("You must enter a file"));
|
||||
return;
|
||||
}
|
||||
int count = _context.netDb().reseedChecker().requestReseed(in);
|
||||
if (count <= 0) {
|
||||
addFormError(_("Reseed from file failed"));
|
||||
addFormError(_t("Reseed from file failed"));
|
||||
} else {
|
||||
addFormNotice(ngettext("Reseed successful, loaded {0} router info from file",
|
||||
"Reseed successful, loaded {0} router infos from file",
|
||||
count));
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
addFormError(_("Reseed from file failed") + " - " + ioe);
|
||||
addFormError(_t("Reseed from file failed") + " - " + ioe);
|
||||
} finally {
|
||||
// it's really a ByteArrayInputStream but we'll play along...
|
||||
if (in != null)
|
||||
try { in.close(); } catch (IOException ioe) {}
|
||||
}
|
||||
} else if (_action.equals(_("Save changes"))) {
|
||||
} else if (_action.equals(_t("Save changes"))) {
|
||||
saveChanges();
|
||||
} else if (_action.equals(_("Reset URL list"))) {
|
||||
} else if (_action.equals(_t("Reset URL list"))) {
|
||||
resetUrlList();
|
||||
}
|
||||
//addFormError(_("Unsupported") + ' ' + _action + '.');
|
||||
//addFormError(_t("Unsupported") + ' ' + _action + '.');
|
||||
}
|
||||
|
||||
private void resetUrlList() {
|
||||
if (_context.router().saveConfig(Reseeder.PROP_RESEED_URL, null))
|
||||
addFormNotice(_("URL list reset successfully"));
|
||||
addFormNotice(_t("URL list reset successfully"));
|
||||
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"));
|
||||
}
|
||||
|
||||
/** @since 0.8.9 */
|
||||
@@ -155,9 +155,9 @@ public class ConfigReseedHandler extends FormHandler {
|
||||
saveBoolean(Reseeder.PROP_PROXY_ENABLE, "enable");
|
||||
saveBoolean(Reseeder.PROP_SPROXY_ENABLE, "senable");
|
||||
if (_context.router().saveConfig(changes, removes))
|
||||
addFormNotice(_("Configuration saved successfully."));
|
||||
addFormNotice(_t("Configuration saved successfully."));
|
||||
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"));
|
||||
}
|
||||
|
||||
/** translate (ngettext) @since 0.9.19 */
|
||||
|
@@ -31,24 +31,24 @@ public class ConfigRestartBean {
|
||||
String systemNonce = getNonce();
|
||||
if ( (nonce != null) && (systemNonce.equals(nonce)) && (action != null) ) {
|
||||
// Normal browsers send value, IE sends button label
|
||||
if ("shutdownImmediate".equals(action) || _("Shutdown immediately", ctx).equals(action)) {
|
||||
if ("shutdownImmediate".equals(action) || _t("Shutdown immediately", ctx).equals(action)) {
|
||||
if (ctx.hasWrapper())
|
||||
ConfigServiceHandler.registerWrapperNotifier(ctx, Router.EXIT_HARD, false);
|
||||
//ctx.router().shutdown(Router.EXIT_HARD); // never returns
|
||||
ctx.router().shutdownGracefully(Router.EXIT_HARD); // give the UI time to respond
|
||||
} else if ("cancelShutdown".equals(action) || _("Cancel shutdown", ctx).equals(action) ||
|
||||
_("Cancel restart", ctx).equals(action)) {
|
||||
} else if ("cancelShutdown".equals(action) || _t("Cancel shutdown", ctx).equals(action) ||
|
||||
_t("Cancel restart", ctx).equals(action)) {
|
||||
ctx.router().cancelGracefulShutdown();
|
||||
} else if ("restartImmediate".equals(action) || _("Restart immediately", ctx).equals(action)) {
|
||||
} else if ("restartImmediate".equals(action) || _t("Restart immediately", ctx).equals(action)) {
|
||||
if (ctx.hasWrapper())
|
||||
ConfigServiceHandler.registerWrapperNotifier(ctx, Router.EXIT_HARD_RESTART, false);
|
||||
//ctx.router().shutdown(Router.EXIT_HARD_RESTART); // never returns
|
||||
ctx.router().shutdownGracefully(Router.EXIT_HARD_RESTART); // give the UI time to respond
|
||||
} else if ("restart".equals(action) || _("Restart", ctx).equals(action)) {
|
||||
} else if ("restart".equals(action) || _t("Restart", ctx).equals(action)) {
|
||||
if (ctx.hasWrapper())
|
||||
ConfigServiceHandler.registerWrapperNotifier(ctx, Router.EXIT_GRACEFUL_RESTART, false);
|
||||
ctx.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
|
||||
} else if ("shutdown".equals(action) || _("Shutdown", ctx).equals(action)) {
|
||||
} else if ("shutdown".equals(action) || _t("Shutdown", ctx).equals(action)) {
|
||||
if (ctx.hasWrapper())
|
||||
ConfigServiceHandler.registerWrapperNotifier(ctx, Router.EXIT_GRACEFUL, false);
|
||||
ctx.router().shutdownGracefully();
|
||||
@@ -62,13 +62,13 @@ public class ConfigRestartBean {
|
||||
if ((shuttingDown || restarting) && timeRemaining <= 5*1000) {
|
||||
buf.append("<h4>");
|
||||
if (restarting)
|
||||
buf.append(_("Restart imminent", ctx));
|
||||
buf.append(_t("Restart imminent", ctx));
|
||||
else
|
||||
buf.append(_("Shutdown imminent", ctx));
|
||||
buf.append(_t("Shutdown imminent", ctx));
|
||||
buf.append("</h4>");
|
||||
} else if (shuttingDown) {
|
||||
buf.append("<h4>");
|
||||
buf.append(_("Shutdown in {0}", DataHelper.formatDuration2(timeRemaining), ctx));
|
||||
buf.append(_t("Shutdown in {0}", DataHelper.formatDuration2(timeRemaining), ctx));
|
||||
int tuns = ctx.tunnelManager().getParticipatingCount();
|
||||
if (tuns > 0) {
|
||||
buf.append("<br>").append(ngettext("Please wait for routing commitment to expire for {0} tunnel",
|
||||
@@ -79,7 +79,7 @@ public class ConfigRestartBean {
|
||||
buttons(ctx, buf, urlBase, systemNonce, SET1);
|
||||
} else if (restarting) {
|
||||
buf.append("<h4>");
|
||||
buf.append(_("Restart in {0}", DataHelper.formatDuration2(timeRemaining), ctx));
|
||||
buf.append(_t("Restart in {0}", DataHelper.formatDuration2(timeRemaining), ctx));
|
||||
int tuns = ctx.tunnelManager().getParticipatingCount();
|
||||
if (tuns > 0) {
|
||||
buf.append("<br>").append(ngettext("Please wait for routing commitment to expire for {0} tunnel",
|
||||
@@ -105,7 +105,7 @@ public class ConfigRestartBean {
|
||||
buf.append("<button type=\"submit\" name=\"action\" value=\"")
|
||||
.append(s[i]).append("\" class=\"")
|
||||
.append(s[i+1]).append("\" >")
|
||||
.append(_(s[i+2], ctx)).append("</button>\n");
|
||||
.append(_t(s[i+2], ctx)).append("</button>\n");
|
||||
}
|
||||
buf.append("</form>\n");
|
||||
}
|
||||
@@ -126,11 +126,11 @@ public class ConfigRestartBean {
|
||||
return Long.MAX_VALUE/2; // summaryframe.jsp adds a safety factor so we don't want to overflow...
|
||||
}
|
||||
|
||||
private static String _(String s, RouterContext ctx) {
|
||||
private static String _t(String s, RouterContext ctx) {
|
||||
return Messages.getString(s, ctx);
|
||||
}
|
||||
|
||||
private static String _(String s, Object o, RouterContext ctx) {
|
||||
private static String _t(String s, Object o, RouterContext ctx) {
|
||||
return Messages.getString(s, o, ctx);
|
||||
}
|
||||
|
||||
|
@@ -196,60 +196,60 @@ public class ConfigServiceHandler extends FormHandler {
|
||||
protected void processForm() {
|
||||
if (_action == null) return;
|
||||
|
||||
if (_("Shutdown gracefully").equals(_action)) {
|
||||
if (_t("Shutdown gracefully").equals(_action)) {
|
||||
if (_context.hasWrapper())
|
||||
registerWrapperNotifier(Router.EXIT_GRACEFUL, false);
|
||||
_context.router().shutdownGracefully();
|
||||
addFormNotice(_("Graceful shutdown initiated"));
|
||||
} else if (_("Shutdown immediately").equals(_action)) {
|
||||
addFormNotice(_t("Graceful shutdown initiated"));
|
||||
} else if (_t("Shutdown immediately").equals(_action)) {
|
||||
if (_context.hasWrapper())
|
||||
registerWrapperNotifier(Router.EXIT_HARD, false);
|
||||
_context.router().shutdown(Router.EXIT_HARD);
|
||||
addFormNotice(_("Shutdown immediately"));
|
||||
} else if (_("Cancel graceful shutdown").equals(_action)) {
|
||||
addFormNotice(_t("Shutdown immediately"));
|
||||
} else if (_t("Cancel graceful shutdown").equals(_action)) {
|
||||
_context.router().cancelGracefulShutdown();
|
||||
addFormNotice(_("Graceful shutdown cancelled"));
|
||||
} else if (_("Graceful restart").equals(_action)) {
|
||||
addFormNotice(_t("Graceful shutdown cancelled"));
|
||||
} else if (_t("Graceful restart").equals(_action)) {
|
||||
// should have wrapper if restart button is visible
|
||||
if (_context.hasWrapper())
|
||||
registerWrapperNotifier(Router.EXIT_GRACEFUL_RESTART, false);
|
||||
_context.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
|
||||
addFormNotice(_("Graceful restart requested"));
|
||||
} else if (_("Hard restart").equals(_action)) {
|
||||
addFormNotice(_t("Graceful restart requested"));
|
||||
} else if (_t("Hard restart").equals(_action)) {
|
||||
// should have wrapper if restart button is visible
|
||||
if (_context.hasWrapper())
|
||||
registerWrapperNotifier(Router.EXIT_HARD_RESTART, false);
|
||||
_context.router().shutdown(Router.EXIT_HARD_RESTART);
|
||||
addFormNotice(_("Hard restart requested"));
|
||||
} else if (_("Rekey and Restart").equals(_action)) {
|
||||
addFormNotice(_("Rekeying after graceful restart"));
|
||||
addFormNotice(_t("Hard restart requested"));
|
||||
} else if (_t("Rekey and Restart").equals(_action)) {
|
||||
addFormNotice(_t("Rekeying after graceful restart"));
|
||||
registerWrapperNotifier(Router.EXIT_GRACEFUL_RESTART, true);
|
||||
_context.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
|
||||
} else if (_("Rekey and Shutdown").equals(_action)) {
|
||||
addFormNotice(_("Rekeying after graceful shutdown"));
|
||||
} else if (_t("Rekey and Shutdown").equals(_action)) {
|
||||
addFormNotice(_t("Rekeying after graceful shutdown"));
|
||||
registerWrapperNotifier(Router.EXIT_GRACEFUL, true);
|
||||
_context.router().shutdownGracefully(Router.EXIT_GRACEFUL);
|
||||
} else if (_("Run I2P on startup").equals(_action)) {
|
||||
} else if (_t("Run I2P on startup").equals(_action)) {
|
||||
installService();
|
||||
} else if (_("Don't run I2P on startup").equals(_action)) {
|
||||
} else if (_t("Don't run I2P on startup").equals(_action)) {
|
||||
uninstallService();
|
||||
} else if (_("Dump threads").equals(_action)) {
|
||||
} else if (_t("Dump threads").equals(_action)) {
|
||||
try {
|
||||
WrapperManager.requestThreadDump();
|
||||
} catch (Throwable t) {
|
||||
addFormError("Warning: unable to contact the service manager - " + t.getMessage());
|
||||
}
|
||||
File wlog = LogsHelper.wrapperLogFile(_context);
|
||||
addFormNotice(_("Threads dumped to {0}", wlog.getAbsolutePath()));
|
||||
} else if (_("View console on startup").equals(_action)) {
|
||||
addFormNotice(_t("Threads dumped to {0}", wlog.getAbsolutePath()));
|
||||
} else if (_t("View console on startup").equals(_action)) {
|
||||
browseOnStartup(true);
|
||||
addFormNotice(_("Console is to be shown on startup"));
|
||||
} else if (_("Do not view console on startup").equals(_action)) {
|
||||
addFormNotice(_t("Console is to be shown on startup"));
|
||||
} else if (_t("Do not view console on startup").equals(_action)) {
|
||||
browseOnStartup(false);
|
||||
addFormNotice(_("Console is not to be shown on startup"));
|
||||
} else if (_("Force GC").equals(_action)) {
|
||||
addFormNotice(_t("Console is not to be shown on startup"));
|
||||
} else if (_t("Force GC").equals(_action)) {
|
||||
Runtime.getRuntime().gc();
|
||||
addFormNotice(_("Full garbage collection requested"));
|
||||
addFormNotice(_t("Full garbage collection requested"));
|
||||
} else {
|
||||
//addFormNotice("Blah blah blah. whatever. I'm not going to " + _action);
|
||||
}
|
||||
@@ -258,18 +258,18 @@ public class ConfigServiceHandler extends FormHandler {
|
||||
private void installService() {
|
||||
try {
|
||||
Runtime.getRuntime().exec("install_i2p_service_winnt.bat");
|
||||
addFormNotice(_("Service installed"));
|
||||
addFormNotice(_t("Service installed"));
|
||||
} catch (IOException ioe) {
|
||||
addFormError(_("Warning: unable to install the service") + " - " + ioe.getMessage());
|
||||
addFormError(_t("Warning: unable to install the service") + " - " + ioe.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void uninstallService() {
|
||||
try {
|
||||
Runtime.getRuntime().exec("uninstall_i2p_service_winnt.bat");
|
||||
addFormNotice(_("Service removed"));
|
||||
addFormNotice(_t("Service removed"));
|
||||
} catch (IOException ioe) {
|
||||
addFormError(_("Warning: unable to remove the service") + " - " + ioe.getMessage());
|
||||
addFormError(_t("Warning: unable to remove the service") + " - " + ioe.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -113,16 +113,16 @@ public class ConfigStatsHandler extends FormHandler {
|
||||
changes.put(StatManager.PROP_STAT_FULL, "" + _isFull);
|
||||
_context.router().saveConfig(changes, null);
|
||||
if (!_stats.isEmpty())
|
||||
addFormNotice(_("Stat filter and location updated successfully to") + ": " + stats.toString());
|
||||
addFormNotice(_t("Stat filter and location updated successfully to") + ": " + stats.toString());
|
||||
if (fullChanged) {
|
||||
if (_isFull)
|
||||
addFormNotice(_("Full statistics enabled"));
|
||||
addFormNotice(_t("Full statistics enabled"));
|
||||
else
|
||||
addFormNotice(_("Full statistics disabled"));
|
||||
addFormNotice(_("Restart required to take effect"));
|
||||
addFormNotice(_t("Full statistics disabled"));
|
||||
addFormNotice(_t("Restart required to take effect"));
|
||||
}
|
||||
if (graphsChanged)
|
||||
addFormNoticeNoEscape(_("Graph list updated, may take up to 60s to be reflected on the {0}Graphs Page{1}", "<a href=\"graphs\">", "</a>"));
|
||||
addFormNoticeNoEscape(_t("Graph list updated, may take up to 60s to be reflected on the {0}Graphs Page{1}", "<a href=\"graphs\">", "</a>"));
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -176,8 +176,8 @@ public class ConfigStatsHelper extends HelperBase {
|
||||
*/
|
||||
private class AlphaComparator implements Comparator<String> {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@@ -19,30 +19,30 @@ public class ConfigSummaryHandler 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 saving = _action.equals(_("Save order"));
|
||||
boolean deleting = _action.equals(_t("Delete selected"));
|
||||
boolean adding = _action.equals(_t("Add item"));
|
||||
boolean saving = _action.equals(_t("Save order"));
|
||||
boolean moving = _action.startsWith("move_");
|
||||
if (_action.equals(_("Save")) && "0".equals(group)) {
|
||||
if (_action.equals(_t("Save")) && "0".equals(group)) {
|
||||
try {
|
||||
int refreshInterval = Integer.parseInt(getJettyString("refreshInterval"));
|
||||
if (refreshInterval >= CSSHelper.MIN_REFRESH) {
|
||||
_context.router().saveConfig(CSSHelper.PROP_REFRESH, "" + refreshInterval);
|
||||
addFormNotice(_("Refresh interval changed"));
|
||||
addFormNotice(_t("Refresh interval changed"));
|
||||
} else
|
||||
addFormError(_("Refresh interval must be at least {0} seconds", CSSHelper.MIN_REFRESH));
|
||||
addFormError(_t("Refresh interval must be at least {0} seconds", CSSHelper.MIN_REFRESH));
|
||||
} catch (java.lang.NumberFormatException e) {
|
||||
addFormError(_("Refresh interval must be a number"));
|
||||
addFormError(_t("Refresh interval must be a number"));
|
||||
return;
|
||||
}
|
||||
} else if (_action.equals(_("Restore full default"))) {
|
||||
} else if (_action.equals(_t("Restore full default"))) {
|
||||
_context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.DEFAULT_FULL);
|
||||
addFormNotice(_("Full summary bar default restored.") + " " +
|
||||
_("Summary bar will refresh shortly."));
|
||||
} else if (_action.equals(_("Restore minimal default"))) {
|
||||
addFormNotice(_t("Full summary bar default restored.") + " " +
|
||||
_t("Summary bar will refresh shortly."));
|
||||
} else if (_action.equals(_t("Restore minimal default"))) {
|
||||
_context.router().saveConfig(SummaryHelper.PROP_SUMMARYBAR + "default", SummaryHelper.DEFAULT_MINIMAL);
|
||||
addFormNotice(_("Minimal summary bar default restored.") + " " +
|
||||
_("Summary bar will refresh shortly."));
|
||||
addFormNotice(_t("Minimal summary bar default restored.") + " " +
|
||||
_t("Summary bar will refresh shortly."));
|
||||
} else if (adding || deleting || saving || moving) {
|
||||
Map<Integer, String> sections = new TreeMap<Integer, String>();
|
||||
for (Object o : _settings.keySet()) {
|
||||
@@ -58,19 +58,19 @@ public class ConfigSummaryHandler extends FormHandler {
|
||||
int order = Integer.parseInt(v);
|
||||
sections.put(order, k);
|
||||
} catch (java.lang.NumberFormatException e) {
|
||||
addFormError(_("Order must be an integer"));
|
||||
addFormError(_t("Order must be an integer"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (adding) {
|
||||
String name = getJettyString("name");
|
||||
if (name == null || name.length() <= 0) {
|
||||
addFormError(_("No section selected"));
|
||||
addFormError(_t("No section selected"));
|
||||
return;
|
||||
}
|
||||
String order = getJettyString("order");
|
||||
if (order == null || order.length() <= 0) {
|
||||
addFormError(_("No order entered"));
|
||||
addFormError(_t("No order entered"));
|
||||
return;
|
||||
}
|
||||
name = DataHelper.escapeHTML(name).replace(",", ",");
|
||||
@@ -78,9 +78,9 @@ public class ConfigSummaryHandler extends FormHandler {
|
||||
try {
|
||||
int ki = Integer.parseInt(order);
|
||||
sections.put(ki, name);
|
||||
addFormNotice(_("Added") + ": " + name);
|
||||
addFormNotice(_t("Added") + ": " + name);
|
||||
} catch (java.lang.NumberFormatException e) {
|
||||
addFormError(_("Order must be an integer"));
|
||||
addFormError(_t("Order must be an integer"));
|
||||
return;
|
||||
}
|
||||
} else if (deleting) {
|
||||
@@ -104,7 +104,7 @@ public class ConfigSummaryHandler extends FormHandler {
|
||||
if (toDelete.contains(i)) {
|
||||
String removedName = sections.get(i);
|
||||
iter.remove();
|
||||
addFormNotice(_("Removed") + ": " + removedName);
|
||||
addFormNotice(_t("Removed") + ": " + removedName);
|
||||
}
|
||||
}
|
||||
} else if (moving) {
|
||||
@@ -126,17 +126,17 @@ public class ConfigSummaryHandler extends FormHandler {
|
||||
sections.put(i + n, sections.get(i));
|
||||
sections.put(i, temp);
|
||||
}
|
||||
addFormNotice(_("Moved") + ": " + sections.get(to));
|
||||
addFormNotice(_t("Moved") + ": " + sections.get(to));
|
||||
} catch (java.lang.NumberFormatException e) {
|
||||
addFormError(_("Order must be an integer"));
|
||||
addFormError(_t("Order must be an integer"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
SummaryHelper.saveSummaryBarSections(_context, "default", sections);
|
||||
addFormNotice(_("Saved order of sections.") + " " +
|
||||
_("Summary bar will refresh shortly."));
|
||||
addFormNotice(_t("Saved order of sections.") + " " +
|
||||
_t("Summary bar will refresh shortly."));
|
||||
} else {
|
||||
//addFormError(_("Unsupported"));
|
||||
//addFormError(_t("Unsupported"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -27,7 +27,7 @@ public class ConfigTunnelsHandler extends FormHandler {
|
||||
}
|
||||
|
||||
public void setShouldsave(String moo) {
|
||||
if ( (moo != null) && (moo.equals(_("Save changes"))) )
|
||||
if ( (moo != null) && (moo.equals(_t("Save changes"))) )
|
||||
_shouldSave = true;
|
||||
}
|
||||
|
||||
@@ -127,14 +127,14 @@ public class ConfigTunnelsHandler extends FormHandler {
|
||||
if (updated > 0)
|
||||
// the count isn't really correct anyway, since we don't check for actual changes
|
||||
//addFormNotice("Updated settings for " + updated + " pools.");
|
||||
addFormNotice(_("Updated settings for all pools."));
|
||||
addFormNotice(_t("Updated settings for all pools."));
|
||||
|
||||
if (saveRequired) {
|
||||
boolean saved = _context.router().saveConfig(changes, null);
|
||||
if (saved)
|
||||
addFormNotice(_("Exploratory tunnel configuration saved successfully."));
|
||||
addFormNotice(_t("Exploratory tunnel configuration saved successfully."));
|
||||
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."));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -30,7 +30,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
TunnelPoolSettings exploratoryIn = _context.tunnelManager().getInboundSettings();
|
||||
TunnelPoolSettings exploratoryOut = _context.tunnelManager().getOutboundSettings();
|
||||
|
||||
renderForm(buf, 0, "exploratory", _("Exploratory tunnels"), exploratoryIn, exploratoryOut);
|
||||
renderForm(buf, 0, "exploratory", _t("Exploratory tunnels"), exploratoryIn, exploratoryOut);
|
||||
|
||||
cur = 1;
|
||||
for (Destination dest : clients) {
|
||||
@@ -46,7 +46,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
name = dest.calculateHash().toBase64().substring(0,6);
|
||||
|
||||
String prefix = dest.calculateHash().toBase64().substring(0,4);
|
||||
renderForm(buf, cur, prefix, _("Client tunnels for {0}", DataHelper.escapeHTML(_(name))), in, out);
|
||||
renderForm(buf, cur, prefix, _t("Client tunnels for {0}", DataHelper.escapeHTML(_t(name))), in, out);
|
||||
cur++;
|
||||
}
|
||||
|
||||
@@ -75,26 +75,26 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
in.getLength() + in.getLengthVariance() <= 0 ||
|
||||
out.getLength() <= 0 ||
|
||||
out.getLength() + out.getLengthVariance() <= 0)
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _("ANONYMITY WARNING - Settings include 0-hop tunnels.") + "</font></th></tr>");
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _t("ANONYMITY WARNING - Settings include 0-hop tunnels.") + "</font></th></tr>");
|
||||
else if (in.getLength() <= 1 ||
|
||||
in.getLength() + in.getLengthVariance() <= 1 ||
|
||||
out.getLength() <= 1 ||
|
||||
out.getLength() + out.getLengthVariance() <= 1)
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _("ANONYMITY WARNING - Settings include 1-hop tunnels.") + "</font></th></tr>");
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _t("ANONYMITY WARNING - Settings include 1-hop tunnels.") + "</font></th></tr>");
|
||||
if (in.getLength() + Math.abs(in.getLengthVariance()) >= WARN_LENGTH ||
|
||||
out.getLength() + Math.abs(out.getLengthVariance()) >= WARN_LENGTH)
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _("PERFORMANCE WARNING - Settings include very long tunnels.") + "</font></th></tr>");
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _t("PERFORMANCE WARNING - Settings include very long tunnels.") + "</font></th></tr>");
|
||||
if (in.getTotalQuantity() >= WARN_QUANTITY ||
|
||||
out.getTotalQuantity() >= WARN_QUANTITY)
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _("PERFORMANCE WARNING - Settings include high tunnel quantities.") + "</font></th></tr>");
|
||||
buf.append("<tr><th colspan=\"3\"><font color=\"red\">" + _t("PERFORMANCE WARNING - Settings include high tunnel quantities.") + "</font></th></tr>");
|
||||
|
||||
buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound Tunnels\"> " + _("Inbound") + "</th><th><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound Tunnels\" title=\"Outbound\"> " + _("Outbound") + "</th></tr>\n");
|
||||
buf.append("<tr><th></th><th><img src=\"/themes/console/images/inbound.png\" alt=\"Inbound\" title=\"Inbound Tunnels\"> " + _t("Inbound") + "</th><th><img src=\"/themes/console/images/outbound.png\" alt=\"Outbound Tunnels\" title=\"Outbound\"> " + _t("Outbound") + "</th></tr>\n");
|
||||
|
||||
// buf.append("<tr><th></th><th>Inbound</th><th>Outbound</th></tr>\n");
|
||||
|
||||
// tunnel depth
|
||||
int maxLength = advanced ? MAX_ADVANCED_LENGTH : MAX_LENGTH;
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Length") + ":</td>\n");
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _t("Length") + ":</td>\n");
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".depthInbound\">\n");
|
||||
int now = in.getLength();
|
||||
renderOptions(buf, 0, maxLength, now, "", HOP);
|
||||
@@ -111,7 +111,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
buf.append("</tr>\n");
|
||||
|
||||
// tunnel depth variance
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Randomization") + ":</td>\n");
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _t("Randomization") + ":</td>\n");
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".varianceInbound\">\n");
|
||||
now = in.getLengthVariance();
|
||||
renderOptions(buf, 0, 0, now, "", HOP);
|
||||
@@ -136,7 +136,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
|
||||
// tunnel quantity
|
||||
int maxQuantity = advanced ? MAX_ADVANCED_QUANTITY : MAX_QUANTITY;
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Quantity") + ":</td>\n");
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _t("Quantity") + ":</td>\n");
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".quantityInbound\">\n");
|
||||
now = in.getQuantity();
|
||||
renderOptions(buf, 1, maxQuantity, now, "", TUNNEL);
|
||||
@@ -154,7 +154,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
|
||||
// tunnel backup quantity
|
||||
int maxBQuantity = advanced ? MAX_ADVANCED_BACKUP_QUANTITY : MAX_BACKUP_QUANTITY;
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Backup quantity") + ":</td>\n");
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _t("Backup quantity") + ":</td>\n");
|
||||
buf.append("<td align=\"center\"><select name=\"").append(index).append(".backupInbound\">\n");
|
||||
now = in.getBackupQuantity();
|
||||
renderOptions(buf, 0, maxBQuantity, now, "", TUNNEL);
|
||||
@@ -176,7 +176,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
// And let's not display them at all unless they have contents, which should be rare.
|
||||
Properties props = in.getUnknownOptions();
|
||||
if (!props.isEmpty()) {
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Inbound options") + ":</td>\n" +
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _t("Inbound options") + ":</td>\n" +
|
||||
"<td colspan=\"2\" align=\"center\"><input name=\"").append(index);
|
||||
buf.append(".inboundOptions\" type=\"text\" size=\"32\" disabled=\"disabled\" " +
|
||||
"value=\"");
|
||||
@@ -188,7 +188,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
}
|
||||
props = out.getUnknownOptions();
|
||||
if (!props.isEmpty()) {
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _("Outbound options") + ":</td>\n" +
|
||||
buf.append("<tr><td align=\"right\" class=\"mediumtags\">" + _t("Outbound options") + ":</td>\n" +
|
||||
"<td colspan=\"2\" align=\"center\"><input name=\"").append(index);
|
||||
buf.append(".outboundOptions\" type=\"text\" size=\"32\" disabled=\"disabled\" " +
|
||||
"value=\"");
|
||||
|
@@ -16,9 +16,9 @@ public class ConfigUIHandler extends FormHandler {
|
||||
protected void processForm() {
|
||||
if (_shouldSave) {
|
||||
saveChanges();
|
||||
} else if (_action.equals(_("Delete selected"))) {
|
||||
} else if (_action.equals(_t("Delete selected"))) {
|
||||
delUser();
|
||||
} else if (_action.equals(_("Add user"))) {
|
||||
} else if (_action.equals(_t("Add user"))) {
|
||||
addUser();
|
||||
}
|
||||
}
|
||||
@@ -60,29 +60,29 @@ public class ConfigUIHandler extends FormHandler {
|
||||
boolean ok = _context.router().saveConfig(changes, removes);
|
||||
if (ok) {
|
||||
if (!oldTheme.equals(_config))
|
||||
addFormNoticeNoEscape(_("Theme change saved.") +
|
||||
addFormNoticeNoEscape(_t("Theme change saved.") +
|
||||
" <a href=\"configui\">" +
|
||||
_("Refresh the page to view.") +
|
||||
_t("Refresh the page to view.") +
|
||||
"</a>");
|
||||
if (oldForceMobileConsole != _forceMobileConsole)
|
||||
addFormNoticeNoEscape(_("Mobile console option saved.") +
|
||||
addFormNoticeNoEscape(_t("Mobile console option saved.") +
|
||||
" <a href=\"configui\">" +
|
||||
_("Refresh the page to view.") +
|
||||
_t("Refresh the page to view.") +
|
||||
"</a>");
|
||||
} 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"));
|
||||
}
|
||||
}
|
||||
|
@@ -15,14 +15,14 @@ public class ConfigUIHelper extends HelperBase {
|
||||
buf.append("<input type=\"radio\" class=\"optbox\" name=\"theme\" ");
|
||||
if (theme.equals(current))
|
||||
buf.append("checked=\"checked\" ");
|
||||
buf.append("value=\"").append(theme).append("\">").append(_(theme)).append("<br>\n");
|
||||
buf.append("value=\"").append(theme).append("\">").append(_t(theme)).append("<br>\n");
|
||||
}
|
||||
boolean universalTheming = _context.getBooleanProperty(CSSHelper.PROP_UNIVERSAL_THEMING);
|
||||
buf.append("<input type=\"checkbox\" name=\"universalTheming\" ");
|
||||
if (universalTheming)
|
||||
buf.append("checked=\"checked\" ");
|
||||
buf.append("value=\"1\">")
|
||||
.append(_("Set theme universally across all apps"))
|
||||
.append(_t("Set theme universally across all apps"))
|
||||
.append("<br>\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("<br>\n");
|
||||
return buf.toString();
|
||||
}
|
||||
@@ -163,13 +163,13 @@ public class ConfigUIHelper extends HelperBase {
|
||||
buf.append("<table>");
|
||||
if (userpw.isEmpty()) {
|
||||
buf.append("<tr><td colspan=\"3\">");
|
||||
buf.append(_("Add a user and password to enable."));
|
||||
buf.append(_t("Add a user and password to enable."));
|
||||
buf.append("</td></tr>");
|
||||
} else {
|
||||
buf.append("<tr><th>")
|
||||
.append(_("Remove"))
|
||||
.append(_t("Remove"))
|
||||
.append("</th><th>")
|
||||
.append(_("User Name"))
|
||||
.append(_t("User Name"))
|
||||
.append("</th><th> </th></tr>\n");
|
||||
for (String name : userpw.keySet()) {
|
||||
buf.append("<tr><td align=\"center\"><input type=\"checkbox\" class=\"optbox\" name=\"delete_")
|
||||
@@ -180,10 +180,10 @@ public class ConfigUIHelper extends HelperBase {
|
||||
}
|
||||
}
|
||||
buf.append("<tr><td align=\"center\"><b>")
|
||||
.append(_("Add")).append(":</b>" +
|
||||
.append(_t("Add")).append(":</b>" +
|
||||
"</td><td align=\"left\"><input type=\"text\" name=\"name\">" +
|
||||
"</td><td align=\"left\"><b>");
|
||||
buf.append(_("Password")).append(":</b> " +
|
||||
buf.append(_t("Password")).append(":</b> " +
|
||||
"<input type=\"password\" size=\"40\" name=\"nofilter_pw\"></td></tr>" +
|
||||
"</table>\n");
|
||||
return buf.toString();
|
||||
|
@@ -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<String, String> changes = new HashMap<String, String>();
|
||||
@@ -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");
|
||||
}
|
||||
|
@@ -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("</option>\n");
|
||||
buf.append("\">").append(_t("Never")).append("</option>\n");
|
||||
else
|
||||
buf.append("\">").append(_("Every")).append(' ').append(DataHelper.formatDuration2(PERIODS[i])).append("</option>\n");
|
||||
buf.append("\">").append(_t("Every")).append(' ').append(DataHelper.formatDuration2(PERIODS[i])).append("</option>\n");
|
||||
}
|
||||
buf.append("</select>\n");
|
||||
return buf.toString();
|
||||
@@ -147,14 +147,14 @@ public class ConfigUpdateHelper extends HelperBase {
|
||||
buf.append("<option value=\"notify\"");
|
||||
if ("notify".equals(policy) || _dontInstall)
|
||||
buf.append(" selected=\"selected\"");
|
||||
buf.append('>').append(_("Notify only")).append("</option>");
|
||||
buf.append('>').append(_t("Notify only")).append("</option>");
|
||||
|
||||
buf.append("<option value=\"download\"");
|
||||
if (_dontInstall)
|
||||
buf.append(" disabled=\"disabled\"");
|
||||
else if ("download".equals(policy))
|
||||
buf.append(" selected=\"selected\"");
|
||||
buf.append('>').append(_("Download and verify only")).append("</option>");
|
||||
buf.append('>').append(_t("Download and verify only")).append("</option>");
|
||||
|
||||
if (_context.hasWrapper()) {
|
||||
buf.append("<option value=\"install\"");
|
||||
@@ -162,7 +162,7 @@ public class ConfigUpdateHelper extends HelperBase {
|
||||
buf.append(" disabled=\"disabled\"");
|
||||
else if ("install".equals(policy))
|
||||
buf.append(" selected=\"selected\"");
|
||||
buf.append('>').append(_("Download, verify, and restart")).append("</option>");
|
||||
buf.append('>').append(_t("Download, verify, and restart")).append("</option>");
|
||||
}
|
||||
|
||||
buf.append("</select>\n");
|
||||
|
@@ -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("<br><h3>" + _("Display Events") + "</h3>");
|
||||
_out.write("<br><h3>" + _t("Display Events") + "</h3>");
|
||||
_out.write("<form action=\"events\" method=\"POST\">\n" +
|
||||
"<input type=\"hidden\" name=\"action\" value=\"save\">\n" +
|
||||
"<input type=\"hidden\" name=\"nonce\" value=\"" + nonce + "\" >\n");
|
||||
_out.write(_("Events since") + ": <select name=\"from\">");
|
||||
_out.write(_t("Events since") + ": <select name=\"from\">");
|
||||
for (int i = 0; i < _times.length; i++) {
|
||||
writeOption(_times[i]);
|
||||
}
|
||||
_out.write("</select><br>");
|
||||
_out.write(_("Event type") + ": <select name=\"type\">");
|
||||
_out.write(_t("Event type") + ": <select name=\"type\">");
|
||||
// sorted by translated display string
|
||||
Map<String, String> events = new TreeMap<String, String>(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<String, String> e : events.entrySet()) {
|
||||
writeOption(e.getKey(), e.getValue());
|
||||
}
|
||||
_out.write("</select>" +
|
||||
"<hr><div class=\"formaction\"><input type=\"submit\" class=\"accept\" value=\"" + _("Filter events") + "\"></div></form>");
|
||||
"<hr><div class=\"formaction\"><input type=\"submit\" class=\"accept\" value=\"" + _t("Filter events") + "\"></div></form>");
|
||||
} 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("</option>\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("<table><tr><th>");
|
||||
buf.append(_("Time"));
|
||||
buf.append(_t("Time"));
|
||||
buf.append("</th><th>");
|
||||
if (isAll) {
|
||||
buf.append(_("Event"));
|
||||
buf.append(_t("Event"));
|
||||
buf.append("</th><th>");
|
||||
buf.append(_("Details"));
|
||||
buf.append(_t("Details"));
|
||||
} else {
|
||||
buf.append(xev);
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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("<img class=\"statimage\""
|
||||
+ " src=\"viewstat.jsp?stat=bw.combined"
|
||||
+ "&periodCount=" + _periodCount
|
||||
@@ -171,7 +171,7 @@ public class GraphHelper extends FormHandler {
|
||||
for (SummaryListener lsnr : ordered) {
|
||||
Rate r = lsnr.getRate();
|
||||
// e.g. "statname for 60m"
|
||||
String title = _("{0} for {1}", r.getRateStat().getName(), DataHelper.formatDuration2(_periodCount * r.getPeriod()));
|
||||
String title = _t("{0} for {1}", r.getRateStat().getName(), DataHelper.formatDuration2(_periodCount * r.getPeriod()));
|
||||
_out.write("<a href=\"graph?stat="
|
||||
+ r.getRateStat().getName()
|
||||
+ '.' + r.getPeriod()
|
||||
@@ -194,7 +194,7 @@ public class GraphHelper extends FormHandler {
|
||||
|
||||
// FIXME jrobin doesn't support setting the timezone, will have to mod TimeAxis.java
|
||||
// 0.9.1 - all graphs currently state UTC on them, so this text blurb is unnecessary,
|
||||
//_out.write("<p><i>" + _("All times are UTC.") + "</i></p>\n");
|
||||
//_out.write("<p><i>" + _t("All times are UTC.") + "</i></p>\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<Rate> rates = StatSummarizer.instance().parseSpecs(_stat);
|
||||
if (rates.size() != 1) {
|
||||
@@ -233,9 +233,9 @@ public class GraphHelper extends FormHandler {
|
||||
displayName = name;
|
||||
}
|
||||
_out.write("<h3>");
|
||||
_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("</h3><img class=\"statimage\" border=\"0\""
|
||||
+ " src=\"viewstat.jsp?stat="
|
||||
@@ -250,57 +250,57 @@ public class GraphHelper extends FormHandler {
|
||||
|
||||
if (_width < MAX_X && _height < MAX_Y) {
|
||||
_out.write(link(_stat, _showEvents, _periodCount, _end, _width * 3 / 2, _height * 3 / 2));
|
||||
_out.write(_("Larger"));
|
||||
_out.write(_t("Larger"));
|
||||
_out.write("</a> - ");
|
||||
}
|
||||
|
||||
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("</a> - ");
|
||||
}
|
||||
|
||||
if (_height < MAX_Y) {
|
||||
_out.write(link(_stat, _showEvents, _periodCount, _end, _width, _height * 3 / 2));
|
||||
_out.write(_("Taller"));
|
||||
_out.write(_t("Taller"));
|
||||
_out.write("</a> - ");
|
||||
}
|
||||
|
||||
if (_height > MIN_Y) {
|
||||
_out.write(link(_stat, _showEvents, _periodCount, _end, _width, _height * 2 / 3));
|
||||
_out.write(_("Shorter"));
|
||||
_out.write(_t("Shorter"));
|
||||
_out.write("</a> - ");
|
||||
}
|
||||
|
||||
if (_width < MAX_X) {
|
||||
_out.write(link(_stat, _showEvents, _periodCount, _end, _width * 3 / 2, _height));
|
||||
_out.write(_("Wider"));
|
||||
_out.write(_t("Wider"));
|
||||
_out.write("</a> - ");
|
||||
}
|
||||
|
||||
if (_width > MIN_X) {
|
||||
_out.write(link(_stat, _showEvents, _periodCount, _end, _width * 2 / 3, _height));
|
||||
_out.write(_("Narrower"));
|
||||
_out.write(_t("Narrower"));
|
||||
_out.write("</a>");
|
||||
}
|
||||
|
||||
_out.write("<br>");
|
||||
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("</a> - ");
|
||||
}
|
||||
|
||||
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("</a>");
|
||||
}
|
||||
|
||||
_out.write("<br>");
|
||||
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("</a>");
|
||||
}
|
||||
|
||||
@@ -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("</a> ");
|
||||
}
|
||||
|
||||
_out.write("<br>");
|
||||
_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("</a>");
|
||||
|
||||
_out.write("</p><p><i>" + _("All times are UTC.") + "</i></p>\n");
|
||||
_out.write("</p><p><i>" + _t("All times are UTC.") + "</i></p>\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("<br><h3>" + _("Configure Graph Display") + " [<a href=\"configstats\">" + _("Select Stats") + "</a>]</h3>");
|
||||
_out.write("<br><h3>" + _t("Configure Graph Display") + " [<a href=\"configstats\">" + _t("Select Stats") + "</a>]</h3>");
|
||||
_out.write("<form action=\"graphs\" method=\"POST\">\n" +
|
||||
"<input type=\"hidden\" name=\"action\" value=\"save\">\n" +
|
||||
"<input type=\"hidden\" name=\"nonce\" value=\"" + nonce + "\" >\n");
|
||||
_out.write(_("Periods") + ": <input size=\"5\" style=\"text-align: right;\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\"><br>\n");
|
||||
_out.write(_("Plot averages") + ": <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"checked\" ") + "> ");
|
||||
_out.write(_("or")+ " " +_("plot events") + ": <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"checked\" " : "") + "><br>\n");
|
||||
_out.write(_("Image sizes") + ": " + _("width") + ": <input size=\"4\" style=\"text-align: right;\" type=\"text\" name=\"width\" value=\"" + _width
|
||||
+ "\"> " + _("pixels") + ", " + _("height") + ": <input size=\"4\" style=\"text-align: right;\" type=\"text\" name=\"height\" value=\"" + _height
|
||||
+ "\"> " + _("pixels") + "<br>\n");
|
||||
_out.write(_("Refresh delay") + ": <select name=\"refreshDelay\">");
|
||||
_out.write(_t("Periods") + ": <input size=\"5\" style=\"text-align: right;\" type=\"text\" name=\"periodCount\" value=\"" + _periodCount + "\"><br>\n");
|
||||
_out.write(_t("Plot averages") + ": <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"false\" " + (_showEvents ? "" : "checked=\"checked\" ") + "> ");
|
||||
_out.write(_t("or")+ " " +_t("plot events") + ": <input type=\"radio\" class=\"optbox\" name=\"showEvents\" value=\"true\" "+ (_showEvents ? "checked=\"checked\" " : "") + "><br>\n");
|
||||
_out.write(_t("Image sizes") + ": " + _t("width") + ": <input size=\"4\" style=\"text-align: right;\" type=\"text\" name=\"width\" value=\"" + _width
|
||||
+ "\"> " + _t("pixels") + ", " + _t("height") + ": <input size=\"4\" style=\"text-align: right;\" type=\"text\" name=\"height\" value=\"" + _height
|
||||
+ "\"> " + _t("pixels") + "<br>\n");
|
||||
_out.write(_t("Refresh delay") + ": <select name=\"refreshDelay\">");
|
||||
for (int i = 0; i < times.length; i++) {
|
||||
_out.write("<option value=\"");
|
||||
_out.write(Integer.toString(times[i]));
|
||||
@@ -374,17 +374,17 @@ public class GraphHelper extends FormHandler {
|
||||
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>\n" +
|
||||
_("Store graph data on disk?") +
|
||||
_t("Store graph data on disk?") +
|
||||
" <input type=\"checkbox\" class=\"optbox\" value=\"true\" name=\"persistent\"");
|
||||
boolean persistent = _context.getBooleanPropertyDefaultTrue(SummaryListener.PROP_PERSISTENT);
|
||||
if (persistent)
|
||||
_out.write(" checked=\"checked\"");
|
||||
_out.write(">" +
|
||||
"<hr><div class=\"formaction\"><input type=\"submit\" class=\"accept\" value=\"" + _("Save settings and redraw graphs") + "\"></div></form>");
|
||||
"<hr><div class=\"formaction\"><input type=\"submit\" class=\"accept\" value=\"" + _t("Save settings and redraw graphs") + "\"></div></form>");
|
||||
} 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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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 "<img src=\"http://console.i2p/onepixel.png?" + _context.random().nextInt() + "\"" +
|
||||
" alt=\"" + _("Your browser is not properly configured to use the HTTP proxy at {0}",
|
||||
" alt=\"" + _t("Your browser is not properly configured to use the HTTP proxy at {0}",
|
||||
_context.getProperty(ConfigUpdateHandler.PROP_PROXY_HOST, ConfigUpdateHandler.DEFAULT_PROXY_HOST) + ':' + port) +
|
||||
"\">";
|
||||
}
|
||||
@@ -168,7 +168,7 @@ public class HomeHelper extends HelperBase {
|
||||
}
|
||||
|
||||
private String renderApps(Collection<App> apps) {
|
||||
String website = _("Website");
|
||||
String website = _t("Website");
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<div class=\"appgroup\">");
|
||||
for (App app : apps) {
|
||||
@@ -205,11 +205,11 @@ public class HomeHelper extends HelperBase {
|
||||
private String renderConfig(Collection<App> apps) {
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<table><tr><th>")
|
||||
.append(_("Remove"))
|
||||
.append(_t("Remove"))
|
||||
.append("</th><th colspan=\"2\">")
|
||||
.append(_("Name"))
|
||||
.append(_t("Name"))
|
||||
.append("</th><th>")
|
||||
.append(_("URL"))
|
||||
.append(_t("URL"))
|
||||
.append("</th></tr>\n");
|
||||
for (App app : apps) {
|
||||
buf.append("<tr><td align=\"center\"><input type=\"checkbox\" class=\"optbox\" name=\"delete_")
|
||||
@@ -232,7 +232,7 @@ public class HomeHelper extends HelperBase {
|
||||
buf.append("</a></td></tr>\n");
|
||||
}
|
||||
buf.append("<tr><td colspan=\"2\" align=\"center\"><b>")
|
||||
.append(_("Add")).append(":</b>" +
|
||||
.append(_t("Add")).append(":</b>" +
|
||||
"</td><td align=\"left\"><input type=\"text\" name=\"nofilter_name\"></td>" +
|
||||
"<td align=\"left\"><input type=\"text\" size=\"40\" name=\"nofilter_url\"></td></tr>");
|
||||
buf.append("</table>\n");
|
||||
|
@@ -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("<b><div class=\"joblog\"><h3>").append(_("I2P Job Queue")).append("</h3><br><div class=\"wideload\">")
|
||||
.append(_("Job runners")).append(": ").append(numRunners)
|
||||
buf.append("<b><div class=\"joblog\"><h3>").append(_t("I2P Job Queue")).append("</h3><br><div class=\"wideload\">")
|
||||
.append(_t("Job runners")).append(": ").append(numRunners)
|
||||
.append("</b><br>\n");
|
||||
|
||||
long now = _context.clock().now();
|
||||
|
||||
buf.append("<hr><b>").append(_("Active jobs")).append(": ").append(activeJobs.size()).append("</b><ol>\n");
|
||||
buf.append("<hr><b>").append(_t("Active jobs")).append(": ").append(activeJobs.size()).append("</b><ol>\n");
|
||||
for (int i = 0; i < activeJobs.size(); i++) {
|
||||
Job j = activeJobs.get(i);
|
||||
buf.append("<li>(").append(_("started {0} ago", DataHelper.formatDuration2(now-j.getTiming().getStartAfter()))).append("): ");
|
||||
buf.append("<li>(").append(_t("started {0} ago", DataHelper.formatDuration2(now-j.getTiming().getStartAfter()))).append("): ");
|
||||
buf.append(j.toString()).append("</li>\n");
|
||||
}
|
||||
buf.append("</ol>\n");
|
||||
|
||||
buf.append("<hr><b>").append(_("Just finished jobs")).append(": ").append(justFinishedJobs.size()).append("</b><ol>\n");
|
||||
buf.append("<hr><b>").append(_t("Just finished jobs")).append(": ").append(justFinishedJobs.size()).append("</b><ol>\n");
|
||||
for (int i = 0; i < justFinishedJobs.size(); i++) {
|
||||
Job j = justFinishedJobs.get(i);
|
||||
buf.append("<li>(").append(_("finished {0} ago", DataHelper.formatDuration2(now-j.getTiming().getActualEnd()))).append("): ");
|
||||
buf.append("<li>(").append(_t("finished {0} ago", DataHelper.formatDuration2(now-j.getTiming().getActualEnd()))).append("): ");
|
||||
buf.append(j.toString()).append("</li>\n");
|
||||
}
|
||||
buf.append("</ol>\n");
|
||||
|
||||
buf.append("<hr><b>").append(_("Ready/waiting jobs")).append(": ").append(readyJobs.size()).append("</b><ol>\n");
|
||||
buf.append("<hr><b>").append(_t("Ready/waiting jobs")).append(": ").append(readyJobs.size()).append("</b><ol>\n");
|
||||
ObjectCounter<String> counter = new ObjectCounter<String>();
|
||||
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("<hr><b>").append(_("Scheduled jobs")).append(": ").append(timedJobs.size()).append("</b><ol>\n");
|
||||
buf.append("<hr><b>").append(_t("Scheduled jobs")).append(": ").append(timedJobs.size()).append("</b><ol>\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("<li>").append(_("{0} will start in {1}", j.getName(), DataHelper.formatDuration2(time)));
|
||||
buf.append("<li>").append(_t("{0} will start in {1}", j.getName(), DataHelper.formatDuration2(time)));
|
||||
// debug, don't bother translating
|
||||
if (time < 0)
|
||||
buf.append(" <b>DELAYED</b>");
|
||||
@@ -110,7 +110,7 @@ public class JobQueueHelper extends HelperBase {
|
||||
out.write(buf.toString());
|
||||
buf.setLength(0);
|
||||
|
||||
buf.append("<hr><b>").append(_("Total Job Statistics")).append("</b>\n");
|
||||
buf.append("<hr><b>").append(_t("Total Job Statistics")).append("</b>\n");
|
||||
getJobStats(buf);
|
||||
out.write(buf.toString());
|
||||
}
|
||||
@@ -121,7 +121,7 @@ public class JobQueueHelper extends HelperBase {
|
||||
if (names.size() < 4)
|
||||
return;
|
||||
buf.append("<table style=\"width: 30%; margin-left: 100px;\">\n" +
|
||||
"<tr><th>").append(_("Job")).append("</th><th>").append(_("Queued")).append("<th>");
|
||||
"<tr><th>").append(_t("Job")).append("</th><th>").append(_t("Queued")).append("<th>");
|
||||
Collections.sort(names, new JobCountComparator(counter));
|
||||
for (String name : names) {
|
||||
buf.append("<tr><td>").append(name)
|
||||
@@ -138,12 +138,12 @@ public class JobQueueHelper extends HelperBase {
|
||||
*/
|
||||
private void getJobStats(StringBuilder buf) {
|
||||
buf.append("<table>\n" +
|
||||
"<tr><th>").append(_("Job")).append("</th><th>").append(_("Runs")).append("</th>" +
|
||||
"<th>").append(_("Dropped")).append("</th>" +
|
||||
"<th>").append(_("Time")).append("</th><th><i>").append(_("Avg")).append("</i></th><th><i>")
|
||||
.append(_("Max")).append("</i></th><th><i>").append(_("Min")).append("</i></th>" +
|
||||
"<th>").append(_("Pending")).append("</th><th><i>").append(_("Avg")).append("</i></th><th><i>")
|
||||
.append(_("Max")).append("</i></th><th><i>").append(_("Min")).append("</i></th></tr>\n");
|
||||
"<tr><th>").append(_t("Job")).append("</th><th>").append(_t("Runs")).append("</th>" +
|
||||
"<th>").append(_t("Dropped")).append("</th>" +
|
||||
"<th>").append(_t("Time")).append("</th><th><i>").append(_t("Avg")).append("</i></th><th><i>")
|
||||
.append(_t("Max")).append("</i></th><th><i>").append(_t("Min")).append("</i></th>" +
|
||||
"<th>").append(_t("Pending")).append("</th><th><i>").append(_t("Avg")).append("</i></th><th><i>")
|
||||
.append(_t("Max")).append("</i></th><th><i>").append(_t("Min")).append("</i></th></tr>\n");
|
||||
long totRuns = 0;
|
||||
long totDropped = 0;
|
||||
long totExecTime = 0;
|
||||
@@ -194,7 +194,7 @@ public class JobQueueHelper extends HelperBase {
|
||||
}
|
||||
|
||||
buf.append("<tr class=\"tablefooter\">");
|
||||
buf.append("<td><b>").append(_("Summary")).append("</b></td>");
|
||||
buf.append("<td><b>").append(_t("Summary")).append("</b></td>");
|
||||
buf.append("<td align=\"right\">").append(totRuns).append("</td>");
|
||||
buf.append("<td align=\"right\">").append(totDropped).append("</td>");
|
||||
buf.append("<td align=\"right\">").append(DataHelper.formatDuration2(totExecTime)).append("</td>");
|
||||
|
@@ -46,7 +46,7 @@ public class LogsHelper extends HelperBase {
|
||||
*/
|
||||
public String getLogs() {
|
||||
String str = formatMessages(_context.logManager().getBuffer().getMostRecentMessages());
|
||||
return "<p>" + _("File location") + ": <b><code>" + _context.logManager().currentFile() + "</code></b></p>" + str;
|
||||
return "<p>" + _t("File location") + ": <b><code>" + _context.logManager().currentFile() + "</code></b></p>" + str;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,10 +97,10 @@ public class LogsHelper extends HelperBase {
|
||||
str = FileUtil.readTextFile(f.getAbsolutePath(), 250, false);
|
||||
}
|
||||
if (str == null) {
|
||||
return "<p>" + _("File not found") + ": <b><code>" + f.getAbsolutePath() + "</code></b></p>";
|
||||
return "<p>" + _t("File not found") + ": <b><code>" + f.getAbsolutePath() + "</code></b></p>";
|
||||
} else {
|
||||
str = str.replace("&", "&").replace("<", "<").replace(">", ">");
|
||||
return "<p>" + _("File location") + ": <b><code>" + f.getAbsolutePath() + "</code></b></p><pre>" + str + "</pre>";
|
||||
return "<p>" + _t("File location") + ": <b><code>" + f.getAbsolutePath() + "</code></b></p><pre>" + str + "</pre>";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class LogsHelper extends HelperBase {
|
||||
/** formats in reverse order */
|
||||
private String formatMessages(List<String> msgs) {
|
||||
if (msgs.isEmpty())
|
||||
return "<p><i>" + _("No log messages") + "</i></p>";
|
||||
return "<p><i>" + _t("No log messages") + "</i></p>";
|
||||
boolean colorize = _context.getBooleanPropertyDefaultTrue("routerconsole.logs.color");
|
||||
StringBuilder buf = new StringBuilder(16*1024);
|
||||
buf.append("<ul>");
|
||||
@@ -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";
|
||||
|
@@ -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.
|
||||
*/
|
||||
|
@@ -125,12 +125,12 @@ public class NetDbHelper extends HelperBase {
|
||||
// we are there
|
||||
if (span)
|
||||
buf.append("<span class=\"tab2\">");
|
||||
buf.append(_(titles[i]));
|
||||
buf.append(_t(titles[i]));
|
||||
} else {
|
||||
// we are not there, make a link
|
||||
if (span)
|
||||
buf.append("<span class=\"tab\">");
|
||||
buf.append("<a href=\"netdb").append(links[i]).append("\">").append(_(titles[i])).append("</a>");
|
||||
buf.append("<a href=\"netdb").append(links[i]).append("\">").append(_t(titles[i])).append("</a>");
|
||||
}
|
||||
if (span)
|
||||
buf.append(" </span>\n");
|
||||
|
@@ -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("<b>").append(_("LeaseSet")).append(": ").append(key.toBase64()).append("</b>\n");
|
||||
buf.append("<b>").append(_t("LeaseSet")).append(": ").append(key.toBase64()).append("</b>\n");
|
||||
if (_context.clientManager().isLocal(dest)) {
|
||||
buf.append(" (<a href=\"tunnels#" + key.toBase64().substring(0,4) + "\">" + _("Local") + "</a> ");
|
||||
buf.append(" (<a href=\"tunnels#" + key.toBase64().substring(0,4) + "\">" + _t("Local") + "</a> ");
|
||||
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("<a href=\"/susidns/addressbook.jsp?book=private&destination=")
|
||||
.append(dest.toBase64()).append("#add\">").append(_("Add to local addressbook")).append("</a><br>\n");
|
||||
.append(dest.toBase64()).append("#add\">").append(_t("Add to local addressbook")).append("</a><br>\n");
|
||||
}
|
||||
} else {
|
||||
buf.append(" (").append(_("Destination")).append(' ');
|
||||
buf.append(" (").append(_t("Destination")).append(' ');
|
||||
String host = _context.namingService().reverseLookup(dest);
|
||||
if (host != null) {
|
||||
buf.append("<a href=\"http://").append(host).append("/\">").append(host).append("</a>)<br>\n");
|
||||
@@ -182,14 +182,14 @@ public class NetDbRenderer {
|
||||
buf.append(dest.toBase64().substring(0, 6)).append(")<br>\n" +
|
||||
"<a href=\"http://").append(b32).append("\">").append(b32).append("</a><br>\n" +
|
||||
"<a href=\"/susidns/addressbook.jsp?book=private&destination=")
|
||||
.append(dest.toBase64()).append("#add\">").append(_("Add to local addressbook")).append("</a><br>\n");
|
||||
.append(dest.toBase64()).append("#add\">").append(_t("Add to local addressbook")).append("</a><br>\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("<br>\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("<br>\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("<table border=\"0\" cellspacing=\"30\"><tr><th colspan=\"3\">")
|
||||
.append(_("Network Database Router Statistics"))
|
||||
.append(_t("Network Database Router Statistics"))
|
||||
.append("</th></tr><tr><td style=\"vertical-align: top;\">");
|
||||
// versions table
|
||||
List<String> versionList = new ArrayList<String>(versions.objects());
|
||||
if (!versionList.isEmpty()) {
|
||||
Collections.sort(versionList, Collections.reverseOrder(new VersionComparator()));
|
||||
buf.append("<table>\n");
|
||||
buf.append("<tr><th>" + _("Version") + "</th><th>" + _("Count") + "</th></tr>\n");
|
||||
buf.append("<tr><th>" + _t("Version") + "</th><th>" + _t("Count") + "</th></tr>\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("<table>\n");
|
||||
buf.append("<tr><th align=\"left\">" + _("Transports") + "</th><th>" + _("Count") + "</th></tr>\n");
|
||||
buf.append("<tr><th align=\"left\">" + _t("Transports") + "</th><th>" + _t("Count") + "</th></tr>\n");
|
||||
for (int i = 0; i < TNAMES.length; i++) {
|
||||
int num = transportCount[i];
|
||||
if (num > 0) {
|
||||
buf.append("<tr><td>").append(_(TNAMES[i]));
|
||||
buf.append("<tr><td>").append(_t(TNAMES[i]));
|
||||
buf.append("</td><td align=\"center\">").append(num).append("</td></tr>\n");
|
||||
}
|
||||
}
|
||||
@@ -367,7 +367,7 @@ public class NetDbRenderer {
|
||||
if (!countryList.isEmpty()) {
|
||||
Collections.sort(countryList, new CountryComparator());
|
||||
buf.append("<table>\n");
|
||||
buf.append("<tr><th align=\"left\">" + _("Country") + "</th><th>" + _("Count") + "</th></tr>\n");
|
||||
buf.append("<tr><th align=\"left\">" + _t("Country") + "</th><th>" + _t("Count") + "</th></tr>\n");
|
||||
for (String country : countryList) {
|
||||
int num = countries.count(country);
|
||||
buf.append("<tr><td><img height=\"11\" width=\"16\" alt=\"").append(country.toUpperCase(Locale.US)).append("\"");
|
||||
@@ -426,29 +426,29 @@ public class NetDbRenderer {
|
||||
String hash = info.getIdentity().getHash().toBase64();
|
||||
buf.append("<table><tr><th><a name=\"").append(hash.substring(0, 6)).append("\" ></a>");
|
||||
if (isUs) {
|
||||
buf.append("<a name=\"our-info\" ></a><b>" + _("Our info") + ": ").append(hash).append("</b></th></tr><tr><td>\n");
|
||||
buf.append("<a name=\"our-info\" ></a><b>" + _t("Our info") + ": ").append(hash).append("</b></th></tr><tr><td>\n");
|
||||
} else {
|
||||
buf.append("<b>" + _("Peer info for") + ":</b> ").append(hash).append("\n");
|
||||
buf.append("<b>" + _t("Peer info for") + ":</b> ").append(hash).append("\n");
|
||||
if (!full) {
|
||||
buf.append("[<a href=\"netdb?r=").append(hash.substring(0, 6)).append("\" >").append(_("Full entry")).append("</a>]");
|
||||
buf.append("[<a href=\"netdb?r=").append(hash.substring(0, 6)).append("\" >").append(_t("Full entry")).append("</a>]");
|
||||
}
|
||||
buf.append("</th></tr><tr><td>\n");
|
||||
}
|
||||
|
||||
long age = _context.clock().now() - info.getPublished();
|
||||
if (isUs && _context.router().isHidden()) {
|
||||
buf.append("<b>").append(_("Hidden")).append(", ").append(_("Updated")).append(":</b> ")
|
||||
.append(_("{0} ago", DataHelper.formatDuration2(age))).append("<br>\n");
|
||||
buf.append("<b>").append(_t("Hidden")).append(", ").append(_t("Updated")).append(":</b> ")
|
||||
.append(_t("{0} ago", DataHelper.formatDuration2(age))).append("<br>\n");
|
||||
} else if (age > 0) {
|
||||
buf.append("<b>").append(_("Published")).append(":</b> ")
|
||||
.append(_("{0} ago", DataHelper.formatDuration2(age))).append("<br>\n");
|
||||
buf.append("<b>").append(_t("Published")).append(":</b> ")
|
||||
.append(_t("{0} ago", DataHelper.formatDuration2(age))).append("<br>\n");
|
||||
} else {
|
||||
// shouldnt happen
|
||||
buf.append("<b>" + _("Published") + ":</b> in ").append(DataHelper.formatDuration2(0-age)).append("???<br>\n");
|
||||
buf.append("<b>" + _t("Published") + ":</b> in ").append(DataHelper.formatDuration2(0-age)).append("???<br>\n");
|
||||
}
|
||||
buf.append("<b>").append(_("Signing Key")).append(":</b> ")
|
||||
buf.append("<b>").append(_t("Signing Key")).append(":</b> ")
|
||||
.append(info.getIdentity().getSigningPublicKey().getType().toString());
|
||||
buf.append("<br>\n<b>" + _("Address(es)") + ":</b> ");
|
||||
buf.append("<br>\n<b>" + _t("Address(es)") + ":</b> ");
|
||||
String country = _context.commSystem().getCountry(info.getIdentity().getHash());
|
||||
if(country != null) {
|
||||
buf.append("<img height=\"11\" width=\"16\" alt=\"").append(country.toUpperCase(Locale.US)).append('\"');
|
||||
@@ -460,17 +460,17 @@ public class NetDbRenderer {
|
||||
buf.append("<b>").append(DataHelper.stripHTML(style)).append(":</b> ");
|
||||
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<Object, Object> p = addr.getOptionsMap();
|
||||
for (Map.Entry<Object, Object> 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("</td></tr>\n");
|
||||
if (full) {
|
||||
buf.append("<tr><td>" + _("Stats") + ": <br><code>");
|
||||
buf.append("<tr><td>" + _t("Stats") + ": <br><code>");
|
||||
Map<Object, Object> p = info.getOptionsMap();
|
||||
for (Map.Entry<Object, Object> 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);
|
||||
}
|
||||
}
|
||||
|
@@ -75,7 +75,7 @@ class ProfileOrganizerRenderer {
|
||||
////
|
||||
if (mode < 2) {
|
||||
|
||||
//buf.append("<h2>").append(_("Peer Profiles")).append("</h2>\n<p>");
|
||||
//buf.append("<h2>").append(_t("Peer Profiles")).append("</h2>\n<p>");
|
||||
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("</p>");
|
||||
buf.append("<table>");
|
||||
buf.append("<tr>");
|
||||
buf.append("<th>").append(_("Peer")).append("</th>");
|
||||
buf.append("<th>").append(_("Groups (Caps)")).append("</th>");
|
||||
buf.append("<th>").append(_("Speed")).append("</th>");
|
||||
buf.append("<th>").append(_("Capacity")).append("</th>");
|
||||
buf.append("<th>").append(_("Integration")).append("</th>");
|
||||
buf.append("<th>").append(_("Status")).append("</th>");
|
||||
buf.append("<th>").append(_t("Peer")).append("</th>");
|
||||
buf.append("<th>").append(_t("Groups (Caps)")).append("</th>");
|
||||
buf.append("<th>").append(_t("Speed")).append("</th>");
|
||||
buf.append("<th>").append(_t("Capacity")).append("</th>");
|
||||
buf.append("<th>").append(_t("Integration")).append("</th>");
|
||||
buf.append("<th>").append(_t("Status")).append("</th>");
|
||||
buf.append("<th> </th>");
|
||||
buf.append("</tr>");
|
||||
int prevTier = 1;
|
||||
@@ -127,12 +127,12 @@ class ProfileOrganizerRenderer {
|
||||
buf.append("</td><td align=\"center\">");
|
||||
|
||||
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("</td><td align=\"right\">").append(num(prof.getIntegrationValue()));
|
||||
buf.append("</td><td align=\"center\">");
|
||||
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(" </td>");
|
||||
//buf.append("<td nowrap align=\"center\"><a target=\"_blank\" href=\"dumpprofile.jsp?peer=")
|
||||
// .append(peer.toBase64().substring(0,6)).append("\">").append(_("profile")).append("</a>");
|
||||
// .append(peer.toBase64().substring(0,6)).append("\">").append(_t("profile")).append("</a>");
|
||||
buf.append("<td nowrap align=\"center\"><a href=\"viewprofile?peer=")
|
||||
.append(peer.toBase64()).append("\">").append(_("profile")).append("</a>");
|
||||
.append(peer.toBase64()).append("\">").append(_t("profile")).append("</a>");
|
||||
buf.append(" <a href=\"configpeer?peer=").append(peer.toBase64()).append("\">+-</a></td>\n");
|
||||
buf.append("</tr>");
|
||||
// let's not build the whole page in memory (~500 bytes per peer)
|
||||
@@ -193,26 +193,26 @@ class ProfileOrganizerRenderer {
|
||||
////
|
||||
} else {
|
||||
|
||||
//buf.append("<h2><a name=\"flood\"></a>").append(_("Floodfill and Integrated Peers"))
|
||||
//buf.append("<h2><a name=\"flood\"></a>").append(_t("Floodfill and Integrated Peers"))
|
||||
// .append(" (").append(integratedPeers.size()).append(")</h2>\n");
|
||||
buf.append("<table>");
|
||||
buf.append("<tr>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Peer")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Caps")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Integ. Value")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Last Heard About")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Last Heard From")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Last Good Send")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Last Bad Send")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("10m Resp. Time")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("1h Resp. Time")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("1d Resp. Time")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Last Good Lookup")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Last Bad Lookup")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Last Good Store")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("Last Bad Store")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("1h Fail Rate")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_("1d Fail Rate")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Peer")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Caps")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Integ. Value")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Last Heard About")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Last Heard From")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Last Good Send")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Last Bad Send")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("10m Resp. Time")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("1h Resp. Time")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("1d Resp. Time")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Last Good Lookup")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Last Bad Lookup")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Last Good Store")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("Last Bad Store")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("1h Fail Rate")).append("</th>");
|
||||
buf.append("<th class=\"smallhead\">").append(_t("1d Fail Rate")).append("</th>");
|
||||
buf.append("</tr>");
|
||||
RateAverages ra = RateAverages.getTemp();
|
||||
for (PeerProfile prof : order) {
|
||||
@@ -244,7 +244,7 @@ class ProfileOrganizerRenderer {
|
||||
buf.append("<td align=\"right\">").append(davg(dbh, 24*60*60*1000l, ra)).append("</td>");
|
||||
} else {
|
||||
for (int i = 0; i < 6; i++)
|
||||
buf.append("<td align=\"right\">").append(_(NA));
|
||||
buf.append("<td align=\"right\">").append(_t(NA));
|
||||
}
|
||||
buf.append("</tr>\n");
|
||||
}
|
||||
@@ -256,20 +256,20 @@ class ProfileOrganizerRenderer {
|
||||
}
|
||||
if (mode < 2) {
|
||||
|
||||
buf.append("<h3>").append(_("Thresholds")).append("</h3>");
|
||||
buf.append("<p><b>").append(_("Speed")).append(":</b> ").append(num(_organizer.getSpeedThreshold()))
|
||||
.append(" (").append(fast).append(' ').append(_("fast peers")).append(")<br>");
|
||||
buf.append("<b>").append(_("Capacity")).append(":</b> ").append(num(_organizer.getCapacityThreshold()))
|
||||
.append(" (").append(reliable).append(' ').append(_("high capacity peers")).append(")<br>");
|
||||
buf.append("<b>").append(_("Integration")).append(":</b> ").append(num(_organizer.getIntegrationThreshold()))
|
||||
.append(" (").append(integrated).append(' ').append(_(" well integrated peers")).append(")</p>");
|
||||
buf.append("<h3>").append(_("Definitions")).append("</h3><ul>");
|
||||
buf.append("<li><b>").append(_("groups")).append("</b>: ").append(_("as determined by the profile organizer")).append("</li>");
|
||||
buf.append("<li><b>").append(_("caps")).append("</b>: ").append(_("capabilities in the netDb, not used to determine profiles")).append("</li>");
|
||||
buf.append("<li><b>").append(_("speed")).append("</b>: ").append(_("peak throughput (bytes per second) over a 1 minute period that the peer has sustained in a single tunnel")).append("</li>");
|
||||
buf.append("<li><b>").append(_("capacity")).append("</b>: ").append(_("how many tunnels can we ask them to join in an hour?")).append("</li>");
|
||||
buf.append("<li><b>").append(_("integration")).append("</b>: ").append(_("how many new peers have they told us about lately?")).append("</li>");
|
||||
buf.append("<li><b>").append(_("status")).append("</b>: ").append(_("is the peer banned, or unreachable, or failing tunnel tests?")).append("</li>");
|
||||
buf.append("<h3>").append(_t("Thresholds")).append("</h3>");
|
||||
buf.append("<p><b>").append(_t("Speed")).append(":</b> ").append(num(_organizer.getSpeedThreshold()))
|
||||
.append(" (").append(fast).append(' ').append(_t("fast peers")).append(")<br>");
|
||||
buf.append("<b>").append(_t("Capacity")).append(":</b> ").append(num(_organizer.getCapacityThreshold()))
|
||||
.append(" (").append(reliable).append(' ').append(_t("high capacity peers")).append(")<br>");
|
||||
buf.append("<b>").append(_t("Integration")).append(":</b> ").append(num(_organizer.getIntegrationThreshold()))
|
||||
.append(" (").append(integrated).append(' ').append(_t(" well integrated peers")).append(")</p>");
|
||||
buf.append("<h3>").append(_t("Definitions")).append("</h3><ul>");
|
||||
buf.append("<li><b>").append(_t("groups")).append("</b>: ").append(_t("as determined by the profile organizer")).append("</li>");
|
||||
buf.append("<li><b>").append(_t("caps")).append("</b>: ").append(_t("capabilities in the netDb, not used to determine profiles")).append("</li>");
|
||||
buf.append("<li><b>").append(_t("speed")).append("</b>: ").append(_t("peak throughput (bytes per second) over a 1 minute period that the peer has sustained in a single tunnel")).append("</li>");
|
||||
buf.append("<li><b>").append(_t("capacity")).append("</b>: ").append(_t("how many tunnels can we ask them to join in an hour?")).append("</li>");
|
||||
buf.append("<li><b>").append(_t("integration")).append("</b>: ").append(_t("how many new peers have they told us about lately?")).append("</li>");
|
||||
buf.append("<li><b>").append(_t("status")).append("</b>: ").append(_t("is the peer banned, or unreachable, or failing tunnel tests?")).append("</li>");
|
||||
buf.append("</ul>");
|
||||
|
||||
////
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -104,12 +104,12 @@ public class ProfilesHelper extends HelperBase {
|
||||
// we are there
|
||||
if (span)
|
||||
buf.append("<span class=\"tab2\">");
|
||||
buf.append(_(titles[i]));
|
||||
buf.append(_t(titles[i]));
|
||||
} else {
|
||||
// we are not there, make a link
|
||||
if (span)
|
||||
buf.append("<span class=\"tab\">");
|
||||
buf.append("<a href=\"profiles").append(links[i]).append("\">").append(_(titles[i])).append("</a>");
|
||||
buf.append("<a href=\"profiles").append(links[i]).append("\">").append(_t(titles[i])).append("</a>");
|
||||
}
|
||||
if (span)
|
||||
buf.append(" </span>\n");
|
||||
|
@@ -71,7 +71,7 @@ public class SearchHelper extends HelperBase {
|
||||
}
|
||||
}
|
||||
StringBuilder buf = new StringBuilder(1024);
|
||||
buf.append("<select name=\"engine\" title=\"").append(_("Select search engine")).append("\">");
|
||||
buf.append("<select name=\"engine\" title=\"").append(_t("Select search engine")).append("\">");
|
||||
for (String name : _engines.keySet()) {
|
||||
buf.append("<option value=\"").append(name).append('\"');
|
||||
if (name.equals(dflt))
|
||||
|
@@ -329,7 +329,7 @@ public class StatSummarizer implements Runnable {
|
||||
else if (height <= 0)
|
||||
height = GraphHelper.DEFAULT_Y;
|
||||
txLsnr.renderPng(out, width, height, hideLegend, hideGrid, hideTitle, showEvents, periodCount,
|
||||
end, showCredit, rxLsnr, _("Bandwidth usage"));
|
||||
end, showCredit, rxLsnr, _t("Bandwidth usage"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -375,7 +375,7 @@ public class StatSummarizer implements Runnable {
|
||||
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)))
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user