Hi,

On Oct 3, 7:26 pm, Zhang Huangbin <[email protected]> wrote:
> Is this a bug?
It might be a side effect of how your translation system is working.
Assuming the reference to the translation function does not change at
runtime (the language might!) and all the translatable strings are
*inside* a macro it should still work.  Eg:

This will work:

  {% macro foo() %}{{ _('holy crap') }}{% endmacro %}

This not:

  {% set foo_text = _('holy crap') %}
  {% macro foo %}{{ foo_text }}{% endmacro %}

If you experience unexpected side effects you can import macros with
context:

  {% from "myfile.html" import blah with context %}

In that case Jinja2 reevaluates your file and does not use a
'sys.module's like singleton cache.


Regards,
Armin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to