[Solved]-Django's I18N with third-party apps

5👍

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/

2👍

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

👤niels

0👍

Detailed:

ln -s full/path/to/installed/app/folder path/to/folder/with/symlinks/in/your/project

and then run

django-admin.py makemessages --locale=*lang* --symlinks

for instance if i want translate django-tagging:

 ln -s /home/user/python_projects/agregator_gitlab/venv/lib/python3.6/site-packages/tagging /home/user/python_projects/agregator_gitlab/agregator/site_aggregator_backend/extra-locales/tagging

(my manage.py locates agregator/site_aggregator_backend/manage.py)

and

django-admin.py makemessages --locale=uk --symlinks

and all work perfectly!

Leave a comment