last fix for translate.py language matching
This commit is contained in:
parent
0ed8e159a9
commit
31c0689628
|
@ -46,7 +46,7 @@ def goog_trans(text, slang, tlang):
|
||||||
def match_language(fragment):
|
def match_language(fragment):
|
||||||
fragment = fragment.lower()
|
fragment = fragment.lower()
|
||||||
for short, _ in lang_pairs:
|
for short, _ in lang_pairs:
|
||||||
if fragment in short.split():
|
if fragment in short.lower().split():
|
||||||
return short.split()[0]
|
return short.split()[0]
|
||||||
|
|
||||||
for short, full in lang_pairs:
|
for short, full in lang_pairs:
|
||||||
|
@ -137,7 +137,7 @@ lang_pairs = [
|
||||||
("be", "Belarusian"),
|
("be", "Belarusian"),
|
||||||
("bg", "Bulgarian"),
|
("bg", "Bulgarian"),
|
||||||
("ca", "Catalan"),
|
("ca", "Catalan"),
|
||||||
("zh-CN", "Chinese"),
|
("zh-CN zh", "Chinese"),
|
||||||
("hr", "Croatian"),
|
("hr", "Croatian"),
|
||||||
("cs", "Czech"),
|
("cs", "Czech"),
|
||||||
("da", "Danish"),
|
("da", "Danish"),
|
||||||
|
@ -159,7 +159,7 @@ lang_pairs = [
|
||||||
("id", "Indonesian"),
|
("id", "Indonesian"),
|
||||||
("ga", "Irish"),
|
("ga", "Irish"),
|
||||||
("it", "Italian"),
|
("it", "Italian"),
|
||||||
("ja jpn", "Japanese"),
|
("ja jp jpn", "Japanese"),
|
||||||
("ko", "Korean"),
|
("ko", "Korean"),
|
||||||
("lv", "Latvian"),
|
("lv", "Latvian"),
|
||||||
("lt", "Lithuanian"),
|
("lt", "Lithuanian"),
|
||||||
|
|
Loading…
Reference in New Issue