Ask Your Question
1

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

asked 2017-02-09 10:01:17 -0500

rosettas's avatar

updated 2017-02-11 09:37:10 -0500

Evgeny's avatar

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-02-11 09:36:30 -0500

Evgeny's avatar

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
edit flag offensive delete link more

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  ( 2017-02-12 15:44:05 -0500 )edit

sorry to update like this, but any solution?

rosettas's avatar rosettas  ( 2017-03-10 10:33:22 -0500 )edit

@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  ( 2018-04-06 14:25:10 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2017-02-09 10:01:17 -0500

Seen: 1,003 times

Last updated: Feb 11 '17