Formulator: Allow translation of ValidationError messages
Depending on how the message is defined. Before this commit, translation happened typically in higher level, where the error message was rendered. but this imposed translation in everything, including mapped messages, pulluting Localizer with unneeded messages. This commit introduces getMessage, the logic is: - If the message is defined in the code that raises, then it should be translated there - If the message is defined in the field (in 'manage_messagesForm') then we need to translate in ValidationError class. Caller should pass translation_service, because we do not want to import it in Formulator
Showing
Please register or sign in to comment