First of all, this looks a great library! I'm trying to integrate it into a project which uses Handlebars templates. However, it seems that the patched makemessages command doesn't support subdirectories under Javascript template directories.
Example:
Let's say I have app test in INSTALLED_APPS, and test/jstemplates is my Javascript template directory for that app. Now, if I put a template handlebars_test.hbs to path test/jstemplates/handlebars_test.hbs, then {% handlebars 'handlebars_test.hbs' %} works beautifully in templates and python manage.py makemessages --all -e html,hbs finds the translation string inside the template correctly.
However, if I put my template to test/jstemplates/test/something/handlebars_test.hbs, {% handlebars 'test/something/handlebars_test.hbs' %} works as expected, but makemessages won't find the translation strings. This seems to be related to how templatize finds all Javascript templates with find("(.*)") (https://github.com/mjumbewu/django-jstemplate/blob/master/jstemplate/management/commands/makemessages.py#L45), which doesn't correctly capture templates in subdirectories.
Hi!
First of all, this looks a great library! I'm trying to integrate it into a project which uses Handlebars templates. However, it seems that the patched
makemessages
command doesn't support subdirectories under Javascript template directories.Example: Let's say I have app
test
inINSTALLED_APPS
, andtest/jstemplates
is my Javascript template directory for that app. Now, if I put a templatehandlebars_test.hbs
to pathtest/jstemplates/handlebars_test.hbs
, then{% handlebars 'handlebars_test.hbs' %}
works beautifully in templates andpython manage.py makemessages --all -e html,hbs
finds the translation string inside the template correctly.However, if I put my template to
test/jstemplates/test/something/handlebars_test.hbs
,{% handlebars 'test/something/handlebars_test.hbs' %}
works as expected, butmakemessages
won't find the translation strings. This seems to be related to howtemplatize
finds all Javascript templates withfind("(.*)")
(https://github.com/mjumbewu/django-jstemplate/blob/master/jstemplate/management/commands/makemessages.py#L45), which doesn't correctly capture templates in subdirectories.