dont wrap in lang="None"
This commit is contained in:
parent
1788f4bac6
commit
d43642c070
1 changed files with 1 additions and 2 deletions
|
@ -22,7 +22,6 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
def extract_subtitles(item, user, layer, translate, gpu=False):
|
||||
if "language" not in item.data:
|
||||
logger.error("skip item without language %s", item.public_id)
|
||||
language = None
|
||||
else:
|
||||
language = ox.iso.langTo2Code(item.data["language"][0])
|
||||
|
@ -69,7 +68,7 @@ def extract_subtitles(item, user, layer, translate, gpu=False):
|
|||
if not annotations:
|
||||
logger.error("no subtitles detected %s", item.public_id)
|
||||
return True
|
||||
if language != "en":
|
||||
if language and language != "en":
|
||||
for annotation in annotations:
|
||||
annotation["value"] = '<span lang="%s">%s</span>' % (language, annotation["value"])
|
||||
|
||||
|
|
Loading…
Reference in a new issue