

def load(cls, dirname=None, locales=None, domain=DEFAULT_DOMAIN):
    'Load translations from the given directory.\n\n        :param dirname: the directory containing the ``MO`` files\n        :param locales: the list of locales in order of preference (items in\n                        this list can be either `Locale` objects or locale\n                        strings)\n        :param domain: the message domain\n        :return: the loaded catalog, or a ``NullTranslations`` instance if no\n                 matching translations were found\n        :rtype: `Translations`\n        '
    if (locales is not None):
        if (not isinstance(locales, (list, tuple))):
            locales = [locales]
        locales = [str(locales) for locale in locales]
    if (not domain):
        domain = cls.DEFAULT_DOMAIN
    filename = gettext.find(domain, dirname, locales)
    if (not filename):
        return gettext.NullTranslations()
    return cls(fileobj=open(filename, 'rb'), domain=domain)

dataset/ETHPy150Open ibagrak/algae/gae/libs/babel/support.py Translations.load/VarMisuse@63/229 `locale`->`locales`