1

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

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?

Rupreck's avatar
305
Rupreck
updated 2011-02-23 09:52:23 -0500, asked 2011-02-23 05:52:42 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

3

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).

Evgeny's avatar
13.2k
Evgeny
updated 2011-02-23 11:52:56 -0500, answered 2011-02-23 11:52:05 -0500
edit flag offensive 0 remove flag delete link

Comments

Thanks for this!
Rupreck's avatar Rupreck (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's avatar Rupreck (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's avatar Evgeny (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's avatar Rupreck (2011-03-08 15:33:28 -0500) edit
add a comment see more comments