Susimail: Add console translate method so strings don't get tagged in susimail bundle

This commit is contained in:
zzz
2016-10-06 14:04:02 +00:00
parent 011d08b172
commit db8a3d5b90

View File

@@ -1657,12 +1657,12 @@ public class WebMail extends HttpServlet
if (nonce == null || !sessionObject.isValidNonce(nonce)) {
// These two strings are already in the router console FormHandler,
// so translate with that bundle.
sessionObject.error = Translate.getString(
sessionObject.error = consoleGetString(
"Invalid form submission, probably because you used the 'back' or 'reload' button on your browser. Please resubmit.",
ctx, CONSOLE_BUNDLE_NAME)
ctx)
+ '\n' +
Translate.getString("If the problem persists, verify that you have cookies enabled in your browser.",
ctx, CONSOLE_BUNDLE_NAME);
consoleGetString("If the problem persists, verify that you have cookies enabled in your browser.",
ctx);
isPOST = false;
}
}
@@ -1834,6 +1834,14 @@ public class WebMail extends HttpServlet
}
}
/**
* Translate with the console bundle.
* @since 0.9.27
*/
private static String consoleGetString(String s, I2PAppContext ctx) {
return Translate.getString(s, ctx, CONSOLE_BUNDLE_NAME);
}
/**
* @param sessionObject
* @param response