Question

Does Pyramid i18n of .pt files support HTML5 mark-up? Currently the i18n tag extractor (Babel?) seems to want XHTML based input and does not accept HTML5 mark-up. Thus if you want to use i18n in .pt files you are forced to write them in XML'ish way?

Was it helpful?

Solution

Chameleon 1 included two Babel extraction plugins (one for python code and one for XML files), which is what the Pyramid documentation is referring to. Chameleon 2 no longer includes those plugins and focuses on its core functionality of being a template library. These two plugins have been cleaned up and are now included in the new lingua package. The pyramid documentation has been updated to reflect that since Pyramid 1.1 (as you can see in the Pyramid 1.1 i18n chapter).

The lingua XML plugin uses expat to parse its input, so will indeed fail on HTML files that do not use XML notation. Since I personally feel quite strongly that XML notation is a much better choice I am not likely to chance the lingua implementation to support non-XML syntax. There is one exception: lingua does allow for missing namespace declaration.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top