Weak password message is not translated in the response

In Openmrs we have a validate password method in OpenmrsUtil.java

If password is empty or if it matches to username when the security.passwordCannotMatchUsername property is set to true we are raising a WeakPasswordException.

In weak password exception we are not getting the translated message

so the response is returning as is.

For the remaining validations we are translating the key and returning

Is that in a unit test or user interface? If user interface, can you attach some screenshots?

It is in user interface.

You may consider moving this to the bahmni talk category.

@dkayiwa, the question is about how Bahmni should be using the OpenMRS API.

@padmavati are you getting this untranslated error message in the Java API or in the REST API? What is your expectation of what should be happening?

It sounds like you’re suggesting that instead of

throw new WeakPasswordException();

we should be doing this

throw new WeakPasswordException(getMessage("error.password.weak"));

@darius The expectation is it should send the translated message like how it is doing for the remaining validations.

throw new WeakPasswordException(getMessage(“error.password.weak”));

Yes we are suggesting this.