使用google translate api的.po文件自动翻译工具包。
lingua.autotranslate的Python项目详细描述
简介
autotranslate是一个使用google的.po文件的自动翻译工具包。 翻译API。
使用量
若要使用此软件包,应将以下部分添加到构建中:
[buildout] ... parts = ... autotranslate ... [autotranslate] recipe = zc.recipe.egg eggs = lingua.autotranslate
当运行bin/buildout时,它将为您创建一个新的控制台脚本, bin/autotranslate至少需要两个参数:
~/workspace/my.product $ bin/autotranslate -h usage: autotranslate [-h] -i <locale> <po file> [-s LANGUAGE] [-u] Translate Po files. optional arguments: -h, --help show this help message and exit -i <locale> <po file> Locale and filename of po-file to process -s LANGUAGE Source language to translate from. -u Force updating translations by retranslating all msgids.
示例:
请参见下面的翻译示例。:
~/workspace/my.product $ bin/autotranslate -i de src/my/product/locales/de/LC_MESSAGES/my.product.po [ Success ] New product -> Neues Produkt [ Success ] Specification -> Beschreibung [ Success ] Language -> Sprache [ Found variable(s) ] ${back} [ Success ] Back to product ${back} -> Zurück zum Produkt $ { back } ...
贡献者
- 丹尼尔·威德林[赛利]<;daniel@widerin.net>;
更改日志
0.2.1(2014-03-17)
- 更新文档。 [航行]
0.2(2014-03-17)
- 打印Found variables消息以通知用户验证 I18N变量,因为它们也会被转换。你需要手动操作 运行lingua.autotranslate后修复它们。 [航行]
- 允许可配置的源语言从语言开始自动翻译 不同于英语。 [航行]
- python 2.7提供了argparse,但python2.6没有。添加为 在Pyton 2.6上运行时的安装要求。 [航行]
0.1(2013-09-06)
- 使用templer创建的包 [航行]