Rename _() for translation to _t() for Java 9 compatibility (ticket #1456)

This commit is contained in:
dg2-new
2015-09-25 19:55:36 +00:00
parent 04690bed9f
commit 22b9876b68
227 changed files with 2930 additions and 2927 deletions

View File

@@ -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"));
}
}