How do I make django translate certain files?
I'm running django-admin.py makemessages -l es
from within my app directory to create trnaslation strings. The result includes only those texts that are located in my app directory. My templates directory to that app is loc开发者_StackOverflowated outside the app's directory. How do I ask django to translate my template files too?
I didn't want to run the above command from within the project's dir, because my project contains certain folders that I do not want to translate.
Never mind, I found the answer. You have to create symlinks to the folders you want to get translated (i.e. templaets) and copy those symlinks to you apps directory and run the above command with --symlinks
included.
If i understand correctly you'll need to use django's trans
and blocktrans
template tags to translate certain strings of text.
精彩评论