简体   繁体   中英

Pyramid Chameleon I18N not finding template files

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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