Script to find all non-i18n parts of a django template

27 views
Skip to first unread message

Rory McCann

unread,
Mar 6, 2011, 5:00:29 PM3/6/11
to Django Users
Hi all,

I'm in the middle of internationalizing an existing Django site. That
basically means adding trans/blocktrans tags to all our templates. It's
a bit of a pain! :P Also I'm likely to miss some string somewhere.

So I wrote a python programme that'll search through a template and
print out all the non-i18n bits of text that you have left to do.

Link to page:
http://www.technomancy.org/python/django-template-i18n-lint/

It's a bit rigid at the moment, and works for our code base. It uses
regular expressions to 'parse' the HTML & Django templates, so it's not
100% perfect, there might be false positives, etc. etc. However I've
found it very useful for myself when working on our site and others
might find it useful

Rory

Venkatraman S

unread,
Mar 6, 2011, 9:09:19 PM3/6/11
to django...@googlegroups.com

On Mon, Mar 7, 2011 at 3:30 AM, Rory McCann <ro...@technomancy.org> wrote:
Link to page:
http://www.technomancy.org/python/django-template-i18n-lint/

Good stuff. I was planning to write one, but would rather use this ;)
IF we make this stuff 'really' good (i mean, handling all false positives etc), then am sure this would be a great boon to the community.

-V-
http://blizzardzblogs.blogspot.com/
Reply all
Reply to author
Forward
0 new messages