def get_messages(self, locale=None):
if locale is None:<EOL><INDENT>locale = self.locale<EOL><DEDENT>if locale not in self.catalogues:<EOL><INDENT>self._load_catalogue(locale)<EOL><DEDENT>catalogues = [self.catalogues[locale]]<EOL>catalogue = catalogues[<NUM_LIT:0>]<EOL>while True:<EOL><INDENT>catalogue = catalogue.fallback_catalogue<EOL>if catalogue is None:<EOL><INDENT>break<EOL><DEDENT>catalogues.append(catalogue)<EOL><DEDENT>messages = {}<EOL>for catalogue in catalogues[::-<NUM_LIT:1>]:<EOL><INDENT>recursive_update(messages, catalogue.all())<EOL><DEDENT>return messages<EOL>
Collects all messages for the given locale.

@type locale:  str|one
@param locale: Locale of translations, by default is current locale

@rtype: dict:
@return: dict indexed by catalog name