wichert / lingua

Translation toolkit for Python
Other
46 stars 32 forks source link

Expression in tal:define fails #39

Closed tsauerwein closed 10 years ago

tsauerwein commented 10 years ago

I have this Chameleon template, which is perfectly accepted by Chameleon:

<form
  tal:define="css_class css_class|string:${field.widget.css_class or field.css_class or ''};"
  >
...
</form>

When I try to run pot-create, I get the following error message:

Aborting due to Python syntax error in %s[%d]: %s ./.../templates/form.pt 1 (css_class|string:${field.widget.css_class or field.css_class or ''})

Is it the ${...} expression which causes the problem?

wichert commented 10 years ago

The problem appears to be that lingua doesn't handle pipe-separated expressions here.

tsauerwein commented 10 years ago

Thanks for the instant fix!

wichert commented 10 years ago

You're welcome! I just released lingua 2.4 with this fix.