* Find ResourceBundles in wars

* Fix restart from config.jsp if no wrapper
    * i2psnark: Elaborate popups
This commit is contained in:
zzz
2009-12-13 15:47:51 +00:00
parent 7feed50af4
commit 3fa9ae0b82
7 changed files with 38 additions and 30 deletions

View File

@ -73,7 +73,7 @@ do
echo "Generating ${CLASS}_$LG ResourceBundle..."
# convert to class files in build/obj
msgfmt --java -r $CLASS -l $LG -d build/obj $i
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo 'Warning - msgfmt failed, not updating translations'

View File

@ -518,7 +518,7 @@ public class I2PSnarkServlet extends HttpServlet {
curPeers + '/' + knownPeers +
" <a href=\"" + uri + "?p=" + Base64.encode(snark.meta.getInfoHash()) + "\">" + _("peers") + "</a>)";
else if (isRunning)
statusString = _("Seeding") + " (" + curPeers + "/" + knownPeers + ' ' + ("peers") + ')';
statusString = _("Seeding") + " (" + curPeers + "/" + knownPeers + ' ' + _("peers") + ')';
else
statusString = _("Complete");
} else {
@ -695,9 +695,9 @@ public class I2PSnarkServlet extends HttpServlet {
} else {
out.write("<font color=#a00000><a title=\"");
if (!peer.isInteresting())
out.write(_("Uninteresting"));
out.write(_("Uninteresting (The peer has no pieces we need)"));
else
out.write(_("Choked"));
out.write(_("Choked (The peer is not allowing us to request pieces)"));
out.write("\">");
out.write(formatSize(peer.getDownloadRate()) + "ps</a></font>");
}
@ -711,9 +711,9 @@ public class I2PSnarkServlet extends HttpServlet {
} else {
out.write("<font color=#a00000><a title=\"");
if (!peer.isInterested())
out.write(_("Uninterested"));
out.write(_("Uninterested (We have no pieces the peer needs)"));
else
out.write(_("Choking"));
out.write(_("Choking (We are not allowing the peer to request pieces)"));
out.write("\">");
out.write(formatSize(peer.getUploadRate()) + "ps</a></font>");
}

View File

@ -104,7 +104,7 @@ do
echo "Generating ${CLASS}_$LG ResourceBundle..."
# convert to class files in build/obj
msgfmt --java -r $CLASS -l $LG -d build/obj $i
msgfmt --java --statistics -r $CLASS -l $LG -d build/obj $i
if [ $? -ne 0 ]
then
echo 'Warning - msgfmt failed, not updating translations'

View File

@ -256,24 +256,26 @@ public class ConfigNetHandler extends FormHandler {
if (switchRequired) {
hiddenSwitch();
} else if (restartRequired) {
// Wow this dumps all conns immediately and really isn't nice
//addFormNotice("Performing a soft restart");
//_context.router().restart();
//addFormNotice("Soft restart complete");
if (System.getProperty("wrapper.version") == null) {
// Wow this dumps all conns immediately and really isn't nice
addFormNotice("Performing a soft restart");
_context.router().restart();
addFormNotice("Soft restart complete");
// Most of the time we aren't changing addresses, just enabling or disabling
// things, so let's try just a new routerInfo and see how that works.
// Maybe we should restart if we change addresses though?
// No, this doesn't work well, really need to call SSU Transport externalAddressReceived(),
// but that's hard to get to, and doesn't handle port changes, etc.
// So don't do this...
//_context.router().rebuildRouterInfo();
//addFormNotice("Router Info rebuilt");
// 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"));
_context.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
// Most of the time we aren't changing addresses, just enabling or disabling
// things, so let's try just a new routerInfo and see how that works.
// Maybe we should restart if we change addresses though?
// No, this doesn't work well, really need to call SSU Transport externalAddressReceived(),
// but that's hard to get to, and doesn't handle port changes, etc.
// So don't do this...
//_context.router().rebuildRouterInfo();
//addFormNotice("Router Info rebuilt");
} 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"));
_context.router().shutdownGracefully(Router.EXIT_GRACEFUL_RESTART);
}
}
}

View File

@ -112,9 +112,8 @@ public abstract class Translate {
ResourceBundle rv = _bundles.get(key);
if (rv == null && !_missing.contains(key)) {
try {
// Would it be faster to specify a class loader?
// No matter we only do this once per lang.
rv = ResourceBundle.getBundle(bun, new Locale(lang));
// We must specify the class loader so that a webapp can find the bundle in the .war
rv = ResourceBundle.getBundle(bun, new Locale(lang), Thread.currentThread().getContextClassLoader());
if (rv != null)
_bundles.put(key, rv);
} catch (MissingResourceException e) {

View File

@ -1,8 +1,15 @@
2009-12-12 zzz
* Disable InternalSockets until it's fixed
2009-12-13 zzz
* Find ResourceBundles in wars
* Fix restart from config.jsp if no wrapper
* i2psnark: Elaborate popups
2009-12-12 welterde
* Sort peers on tunnels.jsp by country
* fix NPE in ^^
2009-12-12 zzz
* Disable InternalSockets until it's fixed
2009-12-11 zzz
* Addressbook, susidns: Rework addressbook into a
HttpServlet, so susidns can kick it when the subscription

View File

@ -18,7 +18,7 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 5;
public final static long BUILD = 6;
/** for example "-test" */
public final static String EXTRA = "";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;