nodes.py 文件源码

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

项目:chalktalk_docs 作者: loremIpsum1771 项目源码 文件源码
def is_translatable(node):
    if isinstance(node, nodes.TextElement):
        if not node.source:
            return False  # built-in message
        if isinstance(node, IGNORED_NODES) and 'translatable' not in node:
            return False
        if not node.get('translatable', True):
            # not(node['translatable'] == True or node['translatable'] is None)
            return False
        # <field_name>orphan</field_name>
        # XXX ignore all metadata (== docinfo)
        if isinstance(node, nodes.field_name) and node.children[0] == 'orphan':
            return False
        return True

    if isinstance(node, nodes.image) and node.get('translatable'):
        return True

    return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号