Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django's I18N with third-party apps

I have a Django project which uses django-tagging and is supposed to run in German. So I looked into the sources and found that django-tagging does indeed use gettext_lazy and is thus completely translatable. However, there are no translations available in the package. So I assume there must be a way for me to translate it from within my project.

In other words, I expect ./manage.py makemessages -a to include untranslated strings from django-tagging, but apparently I'm wrong to expect that.

So, how do I manage this situation properly? Will translating django-tagging in the upstream repository work as expected?

like image 424
Nikolai Prokoschenko Avatar asked Oct 14 '10 13:10

Nikolai Prokoschenko


2 Answers

You can create gettext messages in django-tagging directory and contribute translations to project leader:

django-admin.py makemessages -l de

If you want to create message catalog in your project directory, you should install or symlink app (check -S option of makemessages) in your project directory. Then use manage.py makemessages command as above.

If you want to see more details about translating 3rd part apps, please check:

http://source.mihelac.org/2010/07/31/handling-i18n-in-django-projects/

like image 86
bmihelac Avatar answered Oct 30 '22 20:10

bmihelac


Within my project directory I make a symlink to that third party app and run my makemessages command with the '--symlinks' option:

../manage.py makemessages -l nl --symlinks

then I remove my symlink

like image 43
niels Avatar answered Oct 30 '22 20:10

niels