跳转到主要内容

使用Google Translate API对.po文件进行自动翻译的工具包。

项目描述

简介

lingua.autotranslate 是一个使用 Google Translate API 对 .po 文件进行自动翻译的工具包。

用法

要使用此软件包,您应该将以下部分添加到您的 buildout 中

[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 }
...

作者

贡献者

变更日志

0.2.1 (2014-03-17)

  • 更新文档。 [saily]

0.2 (2014-03-17)

  • 打印 Found variables 消息,以通知用户验证他们的 i18n 变量,因为它们也会被翻译。您需要在运行 lingua.autotranslate 之后手动修复它们。[saily]

  • 允许配置源语言,以便从不同于英语的语言开始自动翻译。[saily]

  • Python 2.7 附带 argparse,但 Python 2.6 不附带。在 Pyton 2.6 上运行时,将其添加为安装要求。[saily]

0.1 (2013-09-06)

  • 使用 templer 创建的软件包[saily]

项目详情


下载文件

下载适用于您平台文件的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分布

lingua.autotranslate-0.2.1.zip (18.0 kB 查看哈希值)

上传时间 源代码

由以下提供支持