wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

'&' in xml extractor isn't picked up + aborts any further processing #13

Closed robinharms closed 10 years ago

robinharms commented 12 years ago

It seems like an &-sign in any xml template causes the message extractor to ignore it. It works with the python extractor though.

Example:

Python extractor picks this up: _(u"Visible & works") XML.extractor doesn't pick this up:

Nonvisible & not picked up

Also, the extractor seems to abort any further work below any statement containing an &-sign. There's no error message either. Any statement above the &-sign works as expected within the same template.

...while using '&' and not having msgids might not be smart, it should at least generate an error i think :)

wichert commented 12 years ago

The reason here is that & is not legal in an XML file: & is used for XML entities. If you want to generate an ampersand-sign you must use &. lingua will abort if it encounters a lone amperand - in fact it has no other option since all XML parsers will abort at that point.

It would be nice to generate an error message though.

robinharms commented 12 years ago

OK that makes sense. I vote critical error in that case, or anything else that might abort scanning a file. Thanks a lot for your quick reply!

wichert commented 10 years ago

This is handled much better in the current version of lingua.