Pyramid Chameleon I18N not finding template files

限于喜欢 提交于 2019-12-25 03:32:03

问题


I'm following this recipe, with a small test project called i18n

Chameleon I18N

I've set up the message_extractors as follows:

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

When I run the extract_messages code, I don't get any templates processed:

../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?


回答1:


That section of the cookbook is outdated: current versions of lingua no longer use Babel, or any configuration through setup.py/setup.cfg. You can use lingua's pot-create command to extract messages from your code and mpaltes instead. The lingua page on PyPI has a fair amount of documentation and examples for doing that.



来源:https://stackoverflow.com/questions/25249963/pyramid-chameleon-i18n-not-finding-template-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!