Ask Your Question
1

How to change and recompile the django.po string resource file?

asked 2011-02-23 05:52:42 -0500

Rupreck gravatar image

updated 2011-02-23 09:52:23 -0500

I assumed using zest.pocompile and typing pocompile in the directory of /en/LC_MESSAGES/django.po would make the .mo but it seems not to work. Is there a way of changing the strings contained within this file and compiling just this file without compiling everything?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2011-02-23 11:52:05 -0500

Evgeny gravatar image

updated 2011-02-23 11:52:56 -0500

There is a handy app called "rosetta" - you can just install it and then you should be able to edit the .po files.

Also - the files are plain text - editable in any text editor.

To compile:

cd askbot
python ../manage.py compilemessages

And to rebuild the file:

cd askbot
python ../manage.py jinja2_makemessages -l en -e html,py,txt

Please note that the compilation command is different from django standard because askbot uses jinja2 templates (they are faster and more flexible).

edit flag offensive delete link more

Comments

Thanks for this!
Rupreck gravatar imageRupreck ( 2011-02-23 16:26:51 -0500 )edit
When I run the first command I get: Error: This script should be run from the Django SVN tree or your project or app tree, or with the settings module
Rupreck gravatar imageRupreck ( 2011-03-08 15:23:42 -0500 )edit
Well it should be run from the "askbot" directory and ../manage.py is important. You are probably are running it from some other directory. Also - where did you install askbot - python site? If so, the instructions will be different. Sorry I have to jump on the plane right now... Will be back later.
Evgeny gravatar imageEvgeny ( 2011-03-08 15:27:10 -0500 )edit
Thanks for such a quick answer. My lack of linux experience here. Running cd /usr/local/lib/python2.6/dist-packages/askbot then sudo python /apps/askbot/manage.py compilemessages worked. Important to ensure the msgid 's are not accidentally altered...
Rupreck gravatar imageRupreck ( 2011-03-08 15:33:28 -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: 2011-02-23 05:52:42 -0500

Seen: 1,224 times

Last updated: Feb 23 '11