• Georgios Dagkakis's avatar
    Formulator: Allow translation of ValidationError messages · 833cb3ad
    Georgios Dagkakis authored
    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
    833cb3ad
Errors.py 1.61 KB