Django i18n Fallback

If your application is already using the django.utils.translation backend, you might force Tml sdk to fully support it.

TML = {  
   ...
   "monkeypatch": True
}

Now template tags such as blocktrans, trans, functions of the form xgettext()(ugettext(), ngettext() and etc.) that imported from django.utils.translation will automatically fallback onto tr() function. For example, If you have the following lines in your base language under corresponding .po file:

#. Translators: This message appears on the home page only
# path/to/python/file.py:123
msgid "Welcome to my site."  
msgstr ""  

You can call:

# inside template
{% trans "Welcome to my site." %}

# or outside the template
from django.utils.translation import ugettext as _  
_("Welcome to my site")  

And the i18n will use Translation Exchange as the backend for your translations. You can continue using Tml's extensions together with the standard trans and blocktrans tags:

{% blocktrans with bar=foo|filter boo=baz|filter %}
    This is {{ bar }} and {{ boo }}.
{% endblocktrans %}

{% trans "this is a test" %}