lessgreen / OpenPUDO

Open PUDO Software Platform
GNU Affero General Public License v3.0
2 stars 1 forks source link

Invalid Phone number at registration with mixed languages #30

Open fpietrosanti opened 2 years ago

fpietrosanti commented 2 years ago

When the application, in english language, do provide error due to invalid phone number it results in inconsistencies:

The errors should be contextual to the application language.

image

GilGalaad commented 2 years ago

this is actually a backend problem. the a field in payload is invalid, the backend generate a localized error message with those patterns

error.empty_mandatory_field=Mandatory field: {0}
error.empty_mandatory_field_coalesce=At least one of the following fields is mandatory: {0}
error.invalid_field=Invalid field: {0}

but the name of the invalid field is taken from the JSON definition of the payload. the backend itself can't know what label is shown in the app for the invalid field, and even if it does, we must localize all the fields of all the jsons objects defined in the swagger. this can be done with no technical issue, but is will require some effort.