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

def _init_i18n(self):

    if (self.config.language is not None):
        logger.info(bold(('loading    translations    [%s]...    ' % self.config.language)), nonl=True)
        user_locale_dirs = [path.join(self.srcdir, x) for x in self.config.locale_dirs]
        for catinfo in find_catalog_source_files(user_locale_dirs, self.config.language, domains=['sphinx'], charset=self.config.source_encoding):
            catinfo.write_mo(self.config.language)
        locale_dirs = ([None, path.join(package_dir, 'locale')] + user_locale_dirs)
    else:
        locale_dirs = []
    (self.translator, has_translation) = locale.init(locale_dirs, self.config.language)
    if (self.config.language is not None):
        if (has_translation or (self.config.language == 'en')):
            logger.info(__('done'))
        else:
            logger.info('not    available    for    built-in    messages')
