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))