构建用于提取和管理po文件的配方
tranchitella.recipe.i18n的Python项目详细描述
tranchitella.recipe.i18n
这个构建方法创建了i18n工具来提取和管理po文件。更多 具体来说,i18n消息可以出现在python代码、chameleon(zpt)页面中 模板和在zcml声明中。
脚本
此配方提供以下脚本:
i18nextract:
extract the i18n messages from the Python code, the Chameleon (ZPT) page templates and the ZCML configuration files;I18N合并:
requires the GNU gettext package to be installed; the command ‘msgmerge’ will be executed for each language;I18n状态:
prints a simple statistics with the status of the translations.
使用量
将以下代码片段添加到构建配置文件中:
[i18n] recipe = tranchitella.recipe.i18n package = PACKAGE zcml = PACKAGE:configure.zcml expressions = first=PACKAGE.expressions:FirstExpression last=PACKAGE.expressions:LastExpression output = locales domain = DOMAIN verify_domain = true exclude = tests.py ftests.py
用python包名替换PACKAGE,用i18n替换DOMAIN。 域;zcml设置是可选的。
0.6(2011-06-20)
- 如果从python文件提取的消息包含utf-8文本,则不要中断。
0.5(2010-06-06)
- 正确处理ZCML文件时对quipu.publisher的软依赖性。
- 避免在自动生成的pot文件末尾出现无用的double新行。
- 避免zope.i18n的MessageID实例的空defaults。
0.4(2010-04-15)
- 更新时重新安装,否则不会更新i18n脚本,除非 它们将被显式删除。
0.3(2010-03-17)
- 在中使用expressions选项添加了对变色龙表达式的支持 buildout.cfg或--expression命令行参数。
- 错误修复:现在,po模板文件已正确编码为utf-8。
- 错误修复:元素的尾部不应包含在msg id中。
- 错误修复:添加了对包含在其他已翻译元素中的已翻译元素的支持 元素并用i18n:name标记。
0.2(2010-03-02)
- 添加了一个新的助手脚本来重新编译po文件。
0.1(2010-02-17)
- 首次公开发行。