'Return transcript information necessary for rendering the XModule student view.
This is more or less a direct extraction from `get_html`.
Args:
transcripts (dict): A dict with all transcripts and a sub.
Returns:
Tuple of (track_url, transcript_language, sorted_languages)
track_url -> subtitle download url
transcript_language -> default transcript language
sorted_languages -> dictionary of available transcript languages'

def get_transcripts_for_student(self, transcripts):

    track_url = None
    (sub, other_lang) = (transcripts['sub'], transcripts['transcripts'])
    if self.download_track:
        if self.track:
            track_url = self.track
        elif (sub or other_lang):
            track_url = self.runtime.handler_url(self, 'transcript', 'download').rstrip('/?')
    transcript_language = self.get_default_transcript_language(transcripts)
    native_languages = {lang: label for (lang, label) in settings.LANGUAGES if (len(lang) == 2)}
    languages = {lang: native_languages.get(lang, display) for (lang, display) in settings.ALL_LANGUAGES if (lang in other_lang)}
    if ((not other_lang) or (other_lang and sub)):
        languages['en'] = 'English'
    sorted_languages = sorted(languages.items(), key=itemgetter(1))
    sorted_languages = OrderedDict(sorted_languages)
    return (track_url, transcript_language, sorted_languages)
