Fork of original project by Rory McCann, https://github.com/rory/django-template-i18n-lint, description by original author: Lint tool to find non-i18n strings in a django template
A simple script to find non-i18n text in a Django and angular templates, including:
-
native Django translation
{% trans 'x' %}
and{% blocktrans %}
-
angular translations using
{[{ 'xx'|translate }]}
and<p translate>paragraph</p>
-
supports a lot of custom angular directives, especially used by ArabellaTech (name starts with aa-)
$ python django_angular_template_i18n_lint.py templates > not_translated.txt
saves all untranslated strings into given file. The original option to wrap in translation blocks was removed, due to support of many translation options (i.e. angular).
Program docs are available:
$ python django_angular_template_i18n_lint --h
Putting {# notrans #}
or <!-- notrans -->
at the begining of line will prevent that line from showin in the results.
-
<div translate><span></span><i class='x'></i>SomeText</div>
will fail due to html tags inside. Required is to use<span translate>value</span>
or{[{ 'x'|translate}]}
-
in some situations it will be preferable to use
{[{ 'x'|translate}]}
instead of<tag translate>
, in example when tag hasdata-
oraa-
orng-
attribute
Code is copyright Rory McCann 2013 and ArabellaTech 2015, and dual licenced under the GNU GPL version3 (or at your option a later version), and the BSD licence. See the files LICENCE.GPLv3 and LICENCE.BSD for more information