Support internationalization (GET)
Related: https://git.happy-dev.fr/startinblox/framework/sib-core/issues/548
Proposed design is as follows:
- Applications which use DjangoLDP (e.g. DjangoLDP-Circle) provide their own translations on models. DjangoLDP's role is to offer serialization into multiple languages following the JSONLD spec
- Offer support for django-modeltranslation-translated fields in the serializers, via an argument which enables behaviour serializing models into multiple language values. This behaviour would be defined within a
TranslationMixin
Side-note:
- Providing it as a setting on the serializer is a good idea in my opinion. For example my site might want values in multiple languages on the landing page, but once I have selected one I want to spare the bandwidth, and only return the activated language
Updated tasks list:
- GET requests include activated language
- Unit tests for various kinds of GET request
- Serializer returns the content with the language passed in the request, in JSON-LD format
- If the translation doesn’t exist, return in the default language (and if this doesn't exist return None)
For now POSTs/PUT will assume the data is in the default language. For this I've created issue #207 (closed)