First time here? Check out the FAQ!
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?

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)
Rupreck's avatar
305
Rupreck
updated 14 years ago, asked 14 years ago

Comments

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

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
updated 14 years ago, answered 14 years ago
link

Comments

Thanks for this!
Rupreck's avatar Rupreck (14 years ago)
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 (14 years ago)
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 (14 years ago)
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 (14 years ago)
see more comments