GetText.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:cron-descriptor 作者: Salamek 项目源码 文件源码
def __init__(self, locale_code):
        """
        Initialize GetText
        :param locale_code selected locale
        """
        try:
            filename = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                    'locale', '{}.mo'.format(locale_code))
            trans = gettext.GNUTranslations(open(filename, "rb"))
            logger.debug('{} Loaded'.format(filename))
        except IOError:
            logger.debug('Failed to found locale {}'.format(locale_code))
            trans = gettext.NullTranslations()

        trans.install()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号