Author: remi
Date: 2009-03-31 13:24:47 +0200 (Tue, 31 Mar 2009)
New Revision: 4282
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/gadgets.xsl
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/GadgetDescription.py
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/WebGadgetTools.py
Log:
* added a new attribute in the gadget.description (ttsName)
- If the attribute is not found in the gadget.xml, ttsName = name.
- This attribute can be translated through the po files.
Modified: software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/gadgets.xsl
===================================================================
--- software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/gadgets.xsl
2009-03-31 11:20:11 UTC (rev 4281)
+++ software_suite_v2/tuxware/tuxdroidserver/trunk/data/xsl/gadgets.xsl
2009-03-31 11:24:47 UTC (rev 4282)
@@ -48,6 +48,10 @@
<xsl:value-of select="description/translated_name"/>
</div>
<div
style="margin-left:20px;font-size:10pt;background-color:#FFFFFF">
+ <span style="font-weight:bold">TTS name : </span>
+ <xsl:value-of select="description/tts_name"/>
+ </div>
+ <div
style="margin-left:20px;font-size:10pt;background-color:#FFFFFF">
<span style="font-weight:bold">UUID : </span>
<xsl:value-of select="description/uuid"/>
</div>
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/GadgetDescription.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/GadgetDescription.py
2009-03-31 11:20:11 UTC (rev 4281)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/GadgetDescription.py
2009-03-31 11:24:47 UTC (rev 4282)
@@ -35,6 +35,7 @@
self.__iconFile = None
self.__helpFile = None
self.__platform = None
+ self.__ttsName = None
self.__update(dictionary, workingPath)
#
--------------------------------------------------------------------------
@@ -74,6 +75,9 @@
self.__platform = "all"
if dictionary.has_key('platform'):
self.__platform = dictionary['platform'].lower()
+ self.__ttsName = self.__name
+ if dictionary.has_key('ttsName'):
+ self.__ttsName = dictionary['ttsName']
#
--------------------------------------------------------------------------
# Get the gadget name.
@@ -97,6 +101,18 @@
return self.__parent.tr2(language, self.__name)
#
--------------------------------------------------------------------------
+ # Get the TTS name of the gadget.
+ #
--------------------------------------------------------------------------
+ def getTtsName(self, language = None):
+ """Get the TTS name of the gadget.
+ @return: A string.
+ """
+ if language == None:
+ return self.__parent.tr(self.__ttsName)
+ else:
+ return self.__parent.tr2(language, self.__ttsName)
+
+ #
--------------------------------------------------------------------------
# Get the uuid of the gadget.
#
--------------------------------------------------------------------------
def getUuid(self):
Modified:
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/WebGadgetTools.py
===================================================================
---
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/WebGadgetTools.py
2009-03-31 11:20:11 UTC (rev 4281)
+++
software_suite_v2/tuxware/tuxdroidserver/trunk/util/applicationserver/gadget/WebGadgetTools.py
2009-03-31 11:24:47 UTC (rev 4282)
@@ -81,6 +81,7 @@
structure['description'] = {}
structure['description']['name'] = description.getName()
structure['description']['translated_name'] =
description.getTranslatedName(language)
+ structure['description']['tts_name'] = description.getTtsName(language)
structure['description']['uuid'] = description.getUuid()
structure['description']['version'] = description.getVersion()
structure['description']['author'] = description.getAuthor()
------------------------------------------------------------------------------
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn