I was wondering, if is there any way to add localization to django-rest-framework api. Because I want to change default message errors.
1 Answer
This is not supported well in Django REST framework 3.0, and it's not supported at all in versions before that.
Most of the strings that DRF uses to display things such as error notices are translatable, and some of them match the Django translations, but for the most part you need to manually find out the translation strings and do the translations on your own. The other option is to override the exception handler and translate within there.
With that said, Django REST framework 3.1 provides a guide on translating and is hooked up to Transifex. If you want your translation included by default in 3.1 (and other future releases), help us and recommend translations on Transifex.