djangodjango-apps

How to provide translations for django standalone app inside app?


I would want to provide translation texts (makemessages and write translation strings) inside django-standalone app, to make app support multiple languages. How it can be done?

Currently, I use from django.utils.translation import gettext to define translation strings. I would not want to run manage.py makemessages command in the parent project and repeat writing translation strings for each parent project.


Solution

  • If you are using Linux you can use this code:

    cd your_app_name
    python ../manage.py makemessages
    

    Also no difference in windows too but I never tested it!

    For more information and understanding the priority of translation directories read this documentation.