Merge pull request #863 from tomovicj/develop

Added translation for filename
This commit is contained in:
Jason authored and GitHub committed 2022-07-05 20:28:34 -04:00
commit bcb4cd6440
1 file changed
+9 -1
+9 -1
View File
@@ -4,6 +4,7 @@ import os
import re
from os.path import exists
from typing import Dict
import translators as ts
from moviepy.editor import (
VideoFileClip,
@@ -35,7 +36,14 @@ def name_normalize(
name = re.sub(r'([0-9]+)\s?\/\s?([0-9]+)', r'\1 of \2', name)
name = re.sub(r'(\w+)\s?\/\s?(\w+)', r'\1 or \2', name)
name = re.sub(r'\/', r'', name)
return name
if os.getenv("POSTLANG") != "":
print_substep("Translating filename...")
translated_name = ts.google(name, to_language=os.getenv("POSTLANG"))
return translated_name
else:
return name
def make_final_video(number_of_clips: int, length: int, reddit_obj: dict):