def bind(self, field_name, parent):
        """
        Create translation serializer dynamically.

        Takes translatable model class (shared_model) from parent serializer and it
        may create a serializer class on the fly if no custom class was specified.
        """
        super(TranslatedFieldsField, self).bind(field_name, parent)

        # Expect 1-on-1 for now. Allow using source as alias,
        # but it should not be a dotted path for now
        related_name = self.source or field_name

        # This could all be done in __init__(), but by moving the code here,
        # it's possible to auto-detect the parent model.
        if self.shared_model is not None and self.serializer_class is not None:
            return

        # Fill in the blanks
        if self.serializer_class is None:
            if self.shared_model is None:
                # Auto detect parent model
                from .serializers import TranslatableModelSerializer
                if not isinstance(parent, TranslatableModelSerializer):
                    raise TypeError("Expected 'TranslatableModelSerializer' as serializer base class")
                if not issubclass(parent.Meta.model, TranslatableModel):
                    raise TypeError("Expected 'TranslatableModel' for the parent model")

                self.shared_model = parent.Meta.model

            # Create serializer based on shared model.
            translated_model = self.shared_model._parler_meta[related_name]
            self.serializer_class = create_translated_fields_serializer(
                self.shared_model, related_name=related_name,
                meta={'fields': translated_model.get_translated_fields()}
            )
        else:
            if not issubclass(self.serializer_class.Meta.model, TranslatedFieldsModel):
                raise TypeError("Expected 'TranslatedFieldsModel' for the serializer model")
Create translation serializer dynamically.

        Takes translatable model class (shared_model) from parent serializer and it
        may create a serializer class on the fly if no custom class was specified.