Güngör Budak's Blog

Bioinformatics, web programming, coding in general

Django Rosetta Translations for Django Applications

Share Tweet

Make a directory called locale/ under the application directory:

cd app_name
mkdir locale

Add the folder in LOCAL_PATHS dictionary in settings.py:

LOCALE_PATHS = (
    os.path.join(PROJECT_ROOT, 'app_name', 'locale/'),
)

Run the following command to create PO translation file for the application:

python ../manage.py makemessages -l tr -e html,py,txt
python ../manage.py compilemessages

Option -l is for language, it should match your definition in settings.py:

LANGUAGES = (
    ('en' _('English')),
    ('tr' _('Turkish')),
    ('it' _('Italian')),
)

Repeat the last step for all languages and the go to Rosetta URL to translate.

Share Tweet

Questions?

Please start a discussion down below or send me an email!