docs: def trans(self, id, parameters=None, domain=None, locale=None):
          """
          Translates the given message.
  
          @type id: str
          @param id: The message id
  
          @type parameters: dict
          @param parameters: A dict of parameters for the message
  
          @type domain: str
          @param domain: The domain for the message or null to use the default
  
          @type locale: str
          @param locale: The locale or null to use the default
  
          @rtype: str
          @return: Translated message
          """
          if parameters is None:
              parameters = {}
          assert isinstance(parameters, dict)
  
          if locale is None:
              locale = self.locale
          else:
              self._assert_valid_locale(locale)
  
          if domain is None:
              domain = 'messages'
  
          msg = self.get_catalogue(locale).get(id, domain)
          return self.format(msg, parameters)