-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Description
It would be great if we had the possibility to replace the standard "Enter a value between 1 and X" error message in the EnumInputReader. I'm developing an application in Portuguese, so the default english message doesn't fit well.
By debugging i found that there isn't any checks for a Message Provider in the method getValueFromIndex of class InputReader:
private T getValueFromIndex(String sVal, TextTerminal<?> textTerminal) {
try {
int optIndex = Integer.parseInt(sVal);
if (optIndex > 0 && optIndex <= this.possibleValues.size()) {
return this.possibleValues.get(optIndex - 1);
}
} catch (NumberFormatException var4) {
}
textTerminal.executeWithPropertiesPrefix("error", (t) -> {
textTerminal.print(this.getDefaultErrorMessage(sVal));
textTerminal.println(" Enter a value between 1 and " + this.possibleValues.size() + ".");
});
textTerminal.println();
return null;
}
Metadata
Metadata
Assignees
Labels
No labels