code: def get_messages(self, locale=None):
          
          if locale is None:
              locale = self.locale
  
          if self.translator:
              def translate(error):
                  return self.translator.translate(error, locale)
          else:
              def translate(error):
                  return error
  
          errors = deepcopy(self.errors)
          errors = self._translate_errors(errors, translate)
          return errors
docs: Get a dictionary of translated messages