code: def get_translations(self, locale):
          
          locale = self.normalize_locale(locale)
          if locale in self.translations:
              return self.translations[locale]
  
          translations = {}
          for path in self.dirs:
              file = os.path.join(path, '{}.py'.format(locale))
              if not os.path.isfile(file):
                  continue
  
              loader = SourceFileLoader(locale, file)
              locale_dict = loader.load_module()
              if not hasattr(locale_dict, 'translations'):
                  continue
  
              language = getattr(locale_dict, 'translations')
              if translations:
                  translations = language
              else:
                  merged = dict(translations.items() | language.items())
                  translations = merged
  
          if translations:
              self.translations[locale] = translations
              return translations
  
          err = 'No translations found for locale [{}]'
          raise NoTranslations(err.format(locale))
docs: Get translation dictionary
          Returns a dictionary for locale or raises an exception if such can't
          be located. If a dictionary for locale was previously loaded returns
          that, otherwise goes through registered locations and merges any
          found custom dictionaries with defaults.
  
          :param locale:          str, locale to load translations
          :return:                dict, translations dictionary