First time here? Check out the FAQ!
1

Why django makemessages exports only two phrases, while many more are expected?
 

I have installed django-rosetta successfully.

But when I was running django-admin makemessages -l de.

I got only two records from django.po:

 #: settings.py:225
msgid "account/"
msgstr ""

#: settings.py:225
msgid "signin/"
msgstr ""

is that anything wrong I did?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
rosettas's avatar
23
rosettas
asked 8 years ago
Evgeny's avatar
13.2k
Evgeny
updated 8 years ago

Comments

see more comments

1 Answer

0

You are confusing django-rosetta with makemessages. The makemessages is a django's built-in command and it must be run from within an app for which you are trying to build the internationalization file.

Change the current directory to the app, then run the command.

cd <path-to-some-app>
python <path-to-manage.py file> makemessages

Notice that Django's makemessages will extract files from django templates, but won't work with Jinja2 templates. For example Askbot (which uses Jinja2 templates) relies on it's own jinja2_makemessages command.

In my development setup I mostly have the askbot app installed in the root of the Django project, so my manage.py file is one level up from askbot directory, therefore I jump into askbot and run

python ../manage.py jinja2-makemessages -l en -e html,py,txt #for .py files and templates.
python ../manage.py makemessages -d djangojs -l en -e js #this time extract strings from .js files

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 8 years ago
link

Comments

thanks. I am running the two commands but same mistake. I got <project>/locale/en/LC_MESSAGES/django.po has still 2 phrases, no any more.

rosettas's avatar rosettas (8 years ago)

sorry to update like this, but any solution?

rosettas's avatar rosettas (8 years ago)

@Evgeny -- if question is worth answering, it would be good practice to upvote it so new user can gain some karma and become able to do more things on this askbot site.

slelievre's avatar slelievre (7 years ago)
see more comments