【问题标题】:Translation Languages Python [closed]翻译语言 Python [关闭]
【发布时间】:2016-03-14 16:52:00
【问题描述】:

我可以使用哪个 API 在 Python 中翻译文本?

我不想使用 Google 或 Bing。还有其他的吗?

Google 一直说“超出天数限制”,必应翻译前 3-4 个问题,然后我得到 “找不到与请求凭据关联的有效 Azure 市场翻译订阅” p>

【问题讨论】:

    标签: python api translation


    【解决方案1】:

    如果你想检查它,我制作了这个脚本:https://github.com/mouuff/Google-Translate-API :)

    非常容易使用:

    to_translate = 'Hola como estas?'
    print("%s >> %s" % (to_translate, translate(to_translate)))
    print("%s >> %s" % (to_translate, translate(to_translate, 'fr')))
    

    应该打印 Hola como estas >> 你好,你好吗

    还有 Hola como estas? >> Bonjour 评论 allez-vous?

    【讨论】:

    • 是的!谢谢,将在 8 分钟内接受:D
    • 但是我的翻译文本有“”
    • 你能把你所做的示例代码发给我吗