code: def get_messages(self, locale=None):
          
          if locale is None:
              locale = self.locale
  
          if locale not in self.catalogues:
              self._load_catalogue(locale)
  
          catalogues = [self.catalogues[locale]]
          catalogue = catalogues[0]
          while True:
              catalogue = catalogue.fallback_catalogue
              if catalogue is None:
                  break
              catalogues.append(catalogue)
  
          messages = {}
          for catalogue in catalogues[::-1]:
              recursive_update(messages, catalogue.all())
  
          return messages
docs: 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