def generate_sjson_for_all_speeds(item, user_filename, result_subs_dict, lang):
 _ = item.runtime.service(item, 'i18n').ugettext
 try:
  srt_transcripts = contentstore().find(Transcript.asset_location(item.location, user_filename))
 except NotFoundError as ex:
  raise TranscriptException(_("{exception_message}: Can't find uploaded transcripts: {user_filename}").format(exception_message=ex.message, user_filename=user_filename))
 if (not lang):
  lang = item.transcript_language
 generate_subs_from_source(result_subs_dict, os.path.splitext(user_filename)[1][1:], srt_transcripts.data.decode('utf-8-sig'), item, lang)

def generate_sjson_for_all_speeds ( item , user_filename , result_subs_dict , lang ) : _ = item . runtime . service ( item , 'i18n' ) . ugettext try : srt_transcripts = contentstore ( ) . find ( Transcript . asset_location ( item . location , user_filename ) ) except NotFoundError as ex : raise TranscriptException ( _ ( "{exception_message}: Can't find uploaded transcripts: {user_filename}" ) . format ( exception_message = ex . message , user_filename = user_filename ) ) if ( not lang ) : lang = item . transcript_language generate_subs_from_source ( result_subs_dict , os . path . splitext ( user_filename ) [ 1 ] [ 1 : ] , srt_transcripts . data . decode ( 'utf-8-sig' ) , item , lang )
generates sjson from srt for given lang .