[tuxdroid-svn] r5484 - software_suite_v3/smart-core/smart-server/trunk/translation
Status: Beta
Brought to you by:
ks156
|
From: remi <c2m...@c2...> - 2009-09-22 14:39:44
|
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):
"""
"""
|