如何翻译金字塔中的选择元素?

时间:2015-03-16 11:02:08

标签: internationalization pyramid pylons

直到几分钟前我才使用这种语法翻译一个select元素,然后我发现这些字符串(<option/>元素的内容)没有在.pot的生成中被捕获文件,因此没有被添加到翻译列表的字符串中。

<select name="sel1">
    <option i18n:translate="all">All</option>
    <option i18n:translate="new_releases">New Releases</option>
</select>

我正在运行版本Pyramid 1.5.2,Lingua 3.9,Babel 1.3

翻译这些<option/>元素的正确方法是什么?

1 个答案:

答案 0 :(得分:1)

此处的问题(在irc上讨论此问题后)是用于从模板中提取消息的命令:您正在使用Babel的update_catalog命令。当前版本的语言不再支持:语言现在有自己的提取框架。这意味着您需要使用lingua的pot-create命令。

lingua documentation解释了为什么语言不再使用Babel,并且有使用pot-create的文档和示例。