WebFaction
Community site: login faq

I am attempting the seemingly simple task of generating translation files for my django project. So far I have made some progress but no coookies just yet.

To start it off I looked through the django site for info, then on stackoverflow and looked through the webfaction community to find everything I could on the topic. The most helpful link I found was this one (link) which is in itself quite helpful, although I can't seem to find the django-admin.py script. Trying a bunch of different options I eventually found out that makemessages could be called using manage.py. Problem solved! Not quite yet.

When calling manage.py makemessages -l fr -a I get a nice error message that goes like so:

Error: This script should be run from the Django SVN tree or your project or app tree. If you did indeed run it from the SVN checkout or your project or application, maybe you are just missing the conf/locale (in the django tree) or locale (for project and application) directory? It is not created automatically, you have to create it by hand if you want to enable i18n for your project or application.

I've made sure to add LOCALE_PATHS to my settings.py file:

LOCALE_PATHS = (
    '/home/me/webapps/django/myproject/myproject/locale',
)

I also have created the following hierarchy in my folders:

/webapps
  /django
    /myproject
       /myproject
         /locale
           /en
           /fr

Same error message, not sure where to go from here. Any help will be very appreciated, I'd love to understand better:

  1. How to generate translation files
  2. The best way to manage project/app translation files
  3. How to make sure translations also look through myproject/urls.py

asked 24 Oct '12, 20:58

mjlavoie
1222
accept rate: 0%

Would you mind please logging a support ticket via your WebFaction Control Panel? We'd like to take a look at your setup and look into it in more depth for you - Wayne K. WebFaction Support.

(24 Oct '12, 21:46) waynek

I found the answer after exchanging with one of WebFaction's great support team members: Right under my nose on the page I had been looking at (link) all along.

There is a comment in the text that goes like this:

To create message files, you use the django-admin.py makemessages tool. You only need to be in the same directory where the locale/ directory is located.

That second sentence is key and I make the mistake of overlooking it. It could of read better like this: You MUST be in the same directory where the locale/ directory is located.

So instead of

>pwd
[path/to/webapps]/webapps/django/myproject
>python2.7 manage.py makemessages --all
Error: This script should be run from the Django SVN tree or your project or...

I did:

>pwd
[path/to/webapps]/webapps/django/myproject/myproject
>python2.7 manage.py makemessages --all
processing language fr
processing language en

Problem solved.

permanent link

answered 27 Oct '12, 10:22

mjlavoie
1222
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×909
×11
×4
×2

question asked: 24 Oct '12, 20:58

question was seen: 15,019 times

last updated: 27 Oct '12, 10:22

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM