gettextutils.py 文件源码

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

项目:python-kingbirdclient 作者: openstack 项目源码 文件源码
def _make_translation_func(self, domain=None):
        """Return a new translation function ready for use.

        Takes into account whether or not lazy translation is being
        done.

        The domain can be specified to override the default from the
        factory, but the localedir from the factory is always used
        because we assume the log-level translation catalogs are
        installed in the same directory as the main application
        catalog.

        """
        if domain is None:
            domain = self.domain
        if self.lazy:
            return functools.partial(Message, domain=domain)
        t = gettext.translation(
            domain,
            localedir=self.localedir,
            fallback=True,
        )
        if six.PY3:
            return t.gettext
        return t.ugettext
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号