From 31c06896284e583362eb7e5a1f7f329e1b9905d9 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Fri, 10 Sep 2010 23:18:26 -0500 Subject: [PATCH] last fix for translate.py language matching --- plugins/translate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/translate.py b/plugins/translate.py index 80a20b2..ec4fd42 100644 --- a/plugins/translate.py +++ b/plugins/translate.py @@ -46,7 +46,7 @@ def goog_trans(text, slang, tlang): def match_language(fragment): fragment = fragment.lower() for short, _ in lang_pairs: - if fragment in short.split(): + if fragment in short.lower().split(): return short.split()[0] for short, full in lang_pairs: @@ -137,7 +137,7 @@ lang_pairs = [ ("be", "Belarusian"), ("bg", "Bulgarian"), ("ca", "Catalan"), - ("zh-CN", "Chinese"), + ("zh-CN zh", "Chinese"), ("hr", "Croatian"), ("cs", "Czech"), ("da", "Danish"), @@ -159,7 +159,7 @@ lang_pairs = [ ("id", "Indonesian"), ("ga", "Irish"), ("it", "Italian"), - ("ja jpn", "Japanese"), + ("ja jp jpn", "Japanese"), ("ko", "Korean"), ("lv", "Latvian"), ("lt", "Lithuanian"),