Author: remi
Date: 2009-09-22 15:44:06 +0200 (Tue, 22 Sep 2009)
New Revision: 5484

Modified:
   software_suite_v3/smart-core/smart-server/trunk/translation/Translation.py
Log:
* Added a method to fixes some word translations into a text

Modified: 
software_suite_v3/smart-core/smart-server/trunk/translation/Translation.py
===================================================================
--- software_suite_v3/smart-core/smart-server/trunk/translation/Translation.py  
2009-09-22 13:30:48 UTC (rev 5483)
+++ software_suite_v3/smart-core/smart-server/trunk/translation/Translation.py  
2009-09-22 13:44:06 UTC (rev 5484)
@@ -44,6 +44,18 @@
             language = "en"
         return self.__i18nList[language].getDictionnary()
 
+    def fixeWordsInText(self, text, language):
+        """
+        """
+        translations = self.getTranslations(language)
+        splitedText = text.lower().split(" ")
+        fixedText = ""
+        for i, word in enumerate(splitedText):
+            if translations.has_key(word):
+                splitedText[i] = translations[word]
+            fixedText += splitedText[i] + " "
+        return fixedText
+
     def getMsgIDList(self):
         """
         """


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to