Before we can have the fun of creating different translations, we need to make sure our installation has the tools necessary to create the files needed for translation.
On Mac and Linux, Django uses the GNU gettext libraries. On Windows, you'll need to install gettext for Windows, available on Sourceforge at the URL http://gnuwin32.sourceforge.net/packages/gettext.htm.
Try the following command to see if you have the libraries installed properly. (The cd
command is included to make sure you're running it from the root of your project, thus saving you from frustrating errors in case you forget.)
$ cd /projects/mycompany/
$ django-admin.py makemessages –l en
Note
django-admin.py
is located in the django/bin
directory. If it's not in your path, you will have to specify the full path to the file to run the command.
If you get no error, you are ready to continue. If you get an error saying that the libraries are not installed properly, do a web search for...