[Dextrose] [PATCH] Words displays 'not available' for words not present in dictionary (SL#2212)

SHACHI PAUL shachi at seeta.in
Thu Oct 14 11:34:29 EDT 2010


If a word is not present in the words dictionary, it shows: 'Word not available in Dictionary' instead of showing the last matching(partial or otherwise) translation.

Signed-off-by: SHACHI PAUL <shachi at seeta.in>
---
 pippy_app.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/pippy_app.py b/pippy_app.py
index b9a5a25..5629857 100644
--- a/pippy_app.py
+++ b/pippy_app.py
@@ -199,12 +199,17 @@ class WordsActivity(ViewSourceActivity):
             self.translated.set_text(",".join(translations))
 
         elif entry in list2 or len(list1) == 0 and len(list2) == 1:
-            langiter = self.lang2combo.get_active()
+            """langiter = self.lang2combo.get_active()
             lang = self.langs[langiter].lower()
             self.fromlang = lang
             self.tolang   = "English"
             translations = self.languagemodel.GetTranslations(1, list2[0])
-            self.translated.set_text(",".join(translations))
+            self.translated.set_text(",".join(translations))"""
+            self.translated.set_text("Word not available in Dictionary")
+
+        elif len(list1) == 0 and len(list2) == 0:
+
+            self.translated.set_text("Word not available in Dictionary")
             
 ############# TEMPLATES AND INLINE FILES ##############
 ACTIVITY_INFO_TEMPLATE = """
-- 
1.7.0.4



More information about the Dextrose mailing list