4

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 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.