You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 28, 2024. It is now read-only.
Would be cool if we could decouple Fortress' dependence on MessageTranslator for translating validation error messages.
What should probably happen instead, is that Fortress should simply return the raw translation keys + placeholder data in its error messages. This would then be passed to the i18n component for translation.
Perhaps at the same time, we could tackle the TODO that's all over UF's controller methods:
// Validate, and throw exception on validation errors.
$validator = new ServerSideValidator($schema, $this->ci->translator);
if (!$validator->validate($data)) {
// TODO: encapsulate the communication of error messages from ServerSideValidator to the BadRequestException
$e = new BadRequestException();
foreach ($validator->errors() as $idx => $field) {
foreach($field as $eidx => $error) {
$e->addUserMessage($error);
}
}
throw $e;
}
In this case, the raw translation keys+data should probably percolate all the way through the BadRequestException as well, and only get translated right at the point when they are about to be rendered for the user (so, Twig template or alert stream).
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Would be cool if we could decouple Fortress' dependence on
MessageTranslator
for translating validation error messages.What should probably happen instead, is that Fortress should simply return the raw translation keys + placeholder data in its error messages. This would then be passed to the i18n component for translation.
Perhaps at the same time, we could tackle the TODO that's all over UF's controller methods:
In this case, the raw translation keys+data should probably percolate all the way through the
BadRequestException
as well, and only get translated right at the point when they are about to be rendered for the user (so, Twig template or alert stream).The text was updated successfully, but these errors were encountered: