def transchoice(self, id, number, parameters=None, domain=None, locale=None):
if parameters is None:<EOL><INDENT>parameters = {}<EOL><DEDENT>assert isinstance(parameters, dict)<EOL>if locale is None:<EOL><INDENT>locale = self.locale<EOL><DEDENT>else:<EOL><INDENT>self._assert_valid_locale(locale)<EOL><DEDENT>if domain is None:<EOL><INDENT>domain = '<STR_LIT>'<EOL><DEDENT>catalogue = self.get_catalogue(locale)<EOL>while not catalogue.defines(id, domain):<EOL><INDENT>cat = catalogue.fallback_catalogue<EOL>if cat:<EOL><INDENT>catalogue = cat<EOL>locale = catalogue.locale<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>parameters['<STR_LIT:count>'] = number<EOL>msg = selector.select_message(<EOL>catalogue.get(<EOL>id,<EOL>domain<EOL>),<EOL>number,<EOL>locale)<EOL>return self.format(msg, parameters)<EOL>
Translates the given choice message by choosing a translation according
to a number.

@type id: The
@param id: message id

@type number: The
@param number: number to use to find the indice of the message

@type parameters: An
@param parameters: array of parameters for the message

@type domain: The
@param domain: domain for the message or null to use the default

@type locale: The
@param locale: locale or null to use the default

@raises: ValueError

@rtype: str
@return: Translated message