'Load translated strings from the configured localedirs if
enabled in the configuration.'

def load_i18n(self):

    self.translator = None
    if (self.config.language is not None):
        self.info(bold(('loading    translations    [%s]...    ' % self.config.language)), nonl=True)
        locale_dirs = ([None, path.join(package_dir, 'locale')] + [path.join(self.srcdir, x) for x in self.config.locale_dirs])
        for dir_ in locale_dirs:
            try:
                trans = gettext.translation('sphinx', localedir=dir_, languages=[self.config.language])
                if (self.translator is None):
                    self.translator = trans
                else:
                    self.translator._catalog.update(trans.catalog)
            except Exception:
                pass
        if (self.translator is not None):
            self.info('done')
        else:
            self.info('locale    not    available')
    if (self.translator is None):
        self.translator = gettext.NullTranslations()
    self.translator.install(unicode=True)
    locale.init()
