-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serializer : Load only languages requested in headers #26
Comments
It would be great feature and strong optimization. I have plans to fetch from DB whole and big articles, only for desired language. In django tastypie it works like a charm. |
Maybe this mixin will help you. Depending on given `from django.conf import settings class TranslatedSerializerMixin(object):
` |
Thanks @chrda81, your solution is very impressive. I made some changes on your code to take a different type of output.
|
I really like this implementation. It seems much more qualitative than the one we implemented on our project.
However, It is possible to load only languages requested in
accept_language
headers ?And maybe the default language if the string is not translated into the desired language?
Example
Because it can quickly produce heavy schemas to return strings in all enabled languages.
Thank you in advance
The text was updated successfully, but these errors were encountered: