简体   繁体   English

金字塔变色龙I18N未找到模板文件

[英]Pyramid Chameleon I18N not finding template files

I'm following this recipe, with a small test project called i18n 我按照这个食谱,通过一个名为i18n的小型测试项目

Chameleon I18N 变色龙I18N

I've set up the message_extractors as follows: 我将message_extractors设置如下:

message_extractors = { '.': [
    ( '**.py', 'lingua_python', None ),
    ( '**.pt', 'lingua_xml', None ),
    ]};

When I run the extract_messages code, I don't get any templates processed: 当我运行extract_messages代码时,没有处理任何模板:

../bin/python setup.py extract_messages -o locale/test.pot
    running extract_messages
    extracting messages from i18n/__init__.py
    extracting messages from i18n/models.py
    extracting messages from i18n/tests.py
    extracting messages from i18n/views.py
    extracting messages from i18n/scripts/__init__.py
    extracting messages from i18n/scripts/initializedb.py
    writing PO template file to locale/test.pot

Why are the template files skipped when they're in the source tree? 为什么模板文件在源代码树中时会被跳过?

That section of the cookbook is outdated: current versions of lingua no longer use Babel, or any configuration through setup.py/setup.cfg. 菜谱的这一部分已经过时:当前版本的lingua不再使用Babel或通过setup.py/setup.cfg进行的任何配置。 You can use lingua's pot-create command to extract messages from your code and mpaltes instead. 您可以使用lingua的pot-create命令从代码中提取消息并改为使用mpaltes。 The lingua page on PyPI has a fair amount of documentation and examples for doing that. PyPI语言页面上有大量的文档和示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM