Encounter DateTime error messages are not being translated

Hi Everybody,

We notice that when we try to save an encounter with a date before the visit start we got the message below, however, this message are not translated to other languages, the same happens if we try to save with a date after the visit end date.

image

The problem it´s here:

The solution I propose it´s simple, change that hard coded messages by message code:

catch (EncounterDateBeforeVisitStartDateException e) {
    validationErrors.add(new FormSubmissionError("general-form-error", Context.getMessageSourceService().getMessage("htmlformentryui.datetimeAfterVisitDate")));
}
catch (EncounterDateAfterVisitStopDateException e) {
    validationErrors.add(new FormSubmissionError("general-form-error",  Context.getMessageSourceService().getMessage("htmlformentryui.datetimeBeforeVisitDate")));
}

Please let me know what do you think.

cc: @mksd

Thanks for reporting this @jfigueiredo, let’s create an HTML Jira ticket for this and get the quick fix through asap.