문제

I want to use multiple language in my app and for that i have followed this doc

After the creation of django.po inside locale folder, I opened that, as this files contain '#' which told you that which line you can translate. But this file only contain admin part it does not have my app templates i.e., HTML files of my app.

So how I can translate those HTML files, OR what should I have to do so that django.po file can also contain my app templates.

I have followed only this doc.

도움이 되었습니까?

해결책

You need to use the {% trans %} or {% blocktrans %} template tags in your html files before you run

python manage.py makemessages -l <locale>

If you have done that, and your HTML templates are inside your source tree, then makemessages should pick them up. If you haven't used those template tags, then you won't see any output from them in your .po file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top