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

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

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

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

Option -l is for language, it should match your definition in

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

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

Share Tweet


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