tags:

views:

153

answers:

1

Hi,

I have an application located in one folder, and templates for it in another one...

I have added translation strings to the templates (which are stored in temaplates directory, I have one directory for all templates in my application)

When I go to the application folder and run a script there:

silver:articles oleg$ django-admin.py makemessages -l ru
processing language ru silver:articles oleg$

I am getting empty silver:articles oleg$ ls locale/ru/LC_MESSAGES/ silver:articles oleg$ And when I am running this command for example in project root, I am getting po file full made from python files (which seems strange to me because I thought it should be created from htmls)

+1  A: 

makemessages always looks for strings marked for translation in python code files.

except for that, it looks in all .html files. maybe your templates have another extension? If that's the case you can use -e to specify other extension:

django-admin.py makemessages -l=ru -e=html,htm,txt
Ofri Raviv
Will it make messages from *py files in this case? E.g. I want to translate my application, but I don't want to translate e.g. filebrowser which is used in django admin
Oleg Tarasenko
I think it will always look in code anyway. If not, try to add py as extension. anything you don't want to translate you can just leave blank in the translation file.
Ofri Raviv