def transchoice(self, id, number, parameters=None, domain=None, locale=None):
if parameters is None:<EOL><INDENT>parameters = {}<EOL><DEDENT>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>if not catalogue.has(id, domain):<EOL><INDENT>raise RuntimeError(<EOL>"<STR_LIT>".format(<EOL>id,<EOL>domain<EOL>)<EOL>)<EOL><DEDENT>parameters['<STR_LIT:count>'] = number<EOL>msg = selector.select_message(<EOL>catalogue.get(<EOL>id,<EOL>domain<EOL>),<EOL>number,<EOL>locale<EOL>)<EOL>return self.format(msg, parameters)<EOL>
Raises a RuntimeError whenever a message is missing
@raises: RuntimeError