Please! I need help with translation custom error messages

344 views
Skip to first unread message

justjew

unread,
Jul 7, 2020, 7:48:20 PM7/7/20
to Django REST framework
I already asked it here, on stackoverflow and several other services. But nobody can give me an answer for this.
The DRF documentation says the following:

If you're only translating custom error messages that exist inside your project codebase you don't need to copy the REST framework source django.po file into a LOCALE_PATHS folder, and can instead simply run Django's standard makemessages process.

So, it works. But after that all DRF error messages are not translated as they were by default.
I don't want to translate the whole DRF .po file. I want to translate ONLY my custom error messages and also I want the default DRF error messages stay translated.

Just in case here's the link to my question on stackoverflow

justjew

unread,
Jul 7, 2020, 8:12:53 PM7/7/20
to Django REST framework
I got it!
Need to exclude messages from packages.
--ignore

e.g. 
python manage.py makemessages -l ru --ignore=env
python manage.py compilemessages -l ru --ignore=env



среда, 8 июля 2020 г., 1:48:20 UTC+2 пользователь justjew написал:
Reply all
Reply to author
Forward
0 new messages