This is a short how-to and checklist for getting Django to server
your app in another langauge. In this case, Spanish.

Modifications to Your Python Code

In views, forms, and models use ugettext_lazy on all strings that will be rendered to the user.

    from django.utils.translation import ugettext_lazy as _ 

Everywhere you have a string, yo need to add _:

#So this...
verbose_name = "This is a model label"
#becomes this...
verbose_name = _("This is a model label")

Modifications to Your Templates

In your templates load the i18n machinery

    {% load i18n %}

and then put all strings that you want to traslate in {% trans %} like so..

{% load i18n %}
{% trans "this is a string to translate"%} 
{% trans "this is another string"%} 

Management Commands in the Console

Now its time to build out the “po” files that can be given to the translator.
In your project’s home directory, create a directory to hold the translations:

mkdir locale

Now make files for spanish.

python makemessages -l es

This will create a file in “yourproject/locale/es/LC_MESSAGES/django.po”.

This is the text file that will contain the translation. The English string is the “key”, called the msgid. You must fill in the msgstr value in spanish for each string.

Now after the translation, you also need to compile to po file. You do this like so.

python compilemessages

Settings File

But wait! Thats not all. We need to make sure we have everything we need in the settings file.

Make sure all this is set in your settings file

USE_I18N = True

Add the middleware class for Locale (not sure this is actually documented)

    'django.middleware.locale.LocaleMiddleware',  #  <-- Add this line

Make sure Django knows where you placed your files.
I also did not find this in the documentation. A friend helped.

    # Always use forward slashes, even on Windows.
    # Don't forget to use absolute paths, not relative paths.
    os.path.join(BASE_DIR, 'locale'),

Now set your browser’s langauge to spanish “ES”. Now you should be muy bueno.