def extract_translations(input_filename, language): print("Extracting translations from %s..." % input_filename) with open(input_filename, 'rb') as in_file: ast = read_ast_from_file(in_file) translator = translate.Translator(language, True) translator.translate_dialogue(ast) # we pickle and unpickle this manually because the regular unpickler will choke on it return magic.safe_dumps(translator.dialogue), translator.strings
def extract_translations(input_filename, language): with printlock: print "Extracting translations from %s..." % input_filename with open(input_filename, 'rb') as in_file: ast = read_ast_from_file(in_file) translator = translate.Translator(language, True) translator.translate_dialogue(ast) # we pickle and unpickle this manually because the regular unpickler will choke on it return magic.safe_dumps(translator.dialogue), translator.strings