<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_representation(self, value):
 """ Serialize translated fields. Simply iterate over available translations and, for each language, delegate serialization logic to the translation model serializer. Output languages can be selected by passing a list of language codes, `languages`, within the serialization context. """

        if value is None:
            return

        # Only need one serializer to create the native objects
        serializer = self.serializer_class(
            instance=self.parent.instance,  # Typically None
            context=self.context,
            partial=self.parent.partial
        )

        # Don't need to have a 'language_code', it will be split up already,
        # so this should avoid redundant output.
        if 'language_code' in serializer.fields:
            raise ImproperlyConfigured("Serializer may not have a 'language_code' field")

        translations = value.all()  # value = translations related manager
        languages = self.context.get('languages')
        if languages:
            translations = translations.filter(language_code__in=languages)

        # Split into a dictionary per language
        result = OrderedDict()
        for translation in translations:
            result[translation.language_code] = serializer.to_representation(translation)

        return result