mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-21 23:32:31 +00:00
Fixed subtitles translation to Portuguese. #2689
This commit is contained in:
parent
79118a494c
commit
7000d2ac2c
1 changed files with 8 additions and 2 deletions
|
@ -28,9 +28,15 @@ def translate_subtitles_file(video_path, source_srt_file, from_lang, to_lang, fo
|
||||||
}
|
}
|
||||||
|
|
||||||
to_lang = alpha3_from_alpha2(to_lang)
|
to_lang = alpha3_from_alpha2(to_lang)
|
||||||
lang_obj = CustomLanguage.from_value(to_lang, "alpha3")
|
try:
|
||||||
if not lang_obj:
|
|
||||||
lang_obj = Language(to_lang)
|
lang_obj = Language(to_lang)
|
||||||
|
except ValueError:
|
||||||
|
custom_lang_obj = CustomLanguage.from_value(to_lang, "alpha3")
|
||||||
|
if custom_lang_obj:
|
||||||
|
lang_obj = CustomLanguage.subzero_language(custom_lang_obj)
|
||||||
|
else:
|
||||||
|
logging.debug(f'BAZARR is unable to translate to {to_lang} for this subtitles: {source_srt_file}')
|
||||||
|
return False
|
||||||
if forced:
|
if forced:
|
||||||
lang_obj = Language.rebuild(lang_obj, forced=True)
|
lang_obj = Language.rebuild(lang_obj, forced=True)
|
||||||
if hi:
|
if hi:
|
||||||
|
|
Loading…
Reference in a new issue