Django intention 'wrap in trans tag' not available.

Answered

I would love to use the  'wrap in trans tag' intention 'described in https://www.jetbrains.com/help/idea/2017.1/extracting-blocks-of-text-from-django-templates.html

However the only intention I get is 'Inject language or reference' or 'Adjust code style settings'.

I am using IntelliJ IDEA 2017.1.4 Build #IU-171.4694.23,

I have enabled the Python Plugin and Django Module seems to be working properly. If I click the "Show structure" buttons in the Django config panel in the project structure my template directories are all listed. 

I also tried to mark a directory as "Template" but with no other result.

When I add a trans tag by hand there is also no i18n tag in the gutter.

Anybody any idea whatr is wrong?

0
3 comments

This features works now for me. I don't know what changes I did make in the mean time which have solved the problem. Also the i18n tags are shown in the gutter now. I can remember that  I did since them was creating a locale directory, running manage.py makemessages/compilemessages and installing the plugin for .po files. 

The {% load i18n %} have been there all the time.

 

0
Avatar
Permanently deleted user

Don`t forget to set Template language to "Django" in Python Template Languages settings.

Maybe it will help someone cause it took me a while to find the reason why option "wrap in trans tag" was absent. 

0

Please sign in to leave a comment.