Skip to content

Commit

Permalink
Merge pull request #211 from jhj0517/fix/translation-output
Browse files Browse the repository at this point in the history
Add output path
  • Loading branch information
jhj0517 authored Jul 13, 2024
2 parents f22356a + e0f6a34 commit e1a6c10
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions modules/translation/deepl_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,17 @@ def translate_deepl(self,

write_file(subtitle, output_path)

files_info[file_name] = subtitle
files_info[file_name] = {"subtitle": subtitle, "path": output_path}
total_result = ''
for file_name, subtitle in files_info.items():
result_file_path = []
for file_name, info in files_info.items():
total_result += '------------------------------------\n'
total_result += f'{file_name}\n\n'
total_result += f'{subtitle}'
total_result += f'{info["subtitle"]}'
result_file_path.append(info["path"])

gr_str = f"Done! Subtitle is in the outputs/translation folder.\n\n{total_result}"
return [gr_str, output_path]
return [gr_str, result_file_path]

def request_deepl_translate(self,
auth_key: str,
Expand Down

0 comments on commit e1a6c10

Please sign in to comment.