We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 65b4587 commit f19eb18Copy full SHA for f19eb18
1 file changed
bin/lib/Language.py
@@ -687,15 +687,21 @@ def detect(self, content):
687
688
def translate(self, content, source=None, target="eng"):
689
# print(source, target)
690
- if target not in get_translation_languages():
691
- return None
+ l_languages = get_translation_languages()
+ if source:
692
+ if source not in l_languages:
693
+ return None, None
694
+ if target not in l_languages:
695
696
translation = None
697
if content:
698
if not source:
699
source = self.detect(content)
700
# print(source, content)
701
if source:
702
if source != target:
703
704
705
try:
706
source_iso1 = convert_iso3_code(source)
707
target_iso1 = convert_iso3_code(target)
0 commit comments