Ask Your Question
1

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

asked Feb 23 '11

Rupreck gravatar image Rupreck
65 1 1 10

updated Feb 23 '11

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?

1 Answer

Sort by ยป oldest newest most voted
3
Rupreck has selected this answer as correct

answered Feb 23 '11

Evgeny gravatar image Evgeny flag of Chile
6665 31 49 95
http://askbot.org/

updated Feb 23 '11

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

link

Comments

Thanks for this! Rupreck (Feb 23 '11)
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 (Mar 08 '11)
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 (Mar 08 '11)
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 (Mar 08 '11)

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
[hide preview]

Question tools

Follow
1 follower

subscribe to rss feed

Stats

Asked: Feb 23 '11

Seen: 185 times

Last updated: Feb 23 '11