[Cdd-commits] r859 - in cdd/trunk/webtools: . templates

CDD Subversion Commit noreply at alioth.debian.org
Thu Jun 26 08:08:07 UTC 2008


Author: tille
Date: Thu Jun 26 08:08:07 2008
New Revision: 859

Modified:
   cdd/trunk/webtools/cddtasktools.py
   cdd/trunk/webtools/tasks.py
   cdd/trunk/webtools/templates/tasks_idx.xhtml
Log:
Even translation of advertising text in conffile works now.


Modified: cdd/trunk/webtools/cddtasktools.py
==============================================================================
--- cdd/trunk/webtools/cddtasktools.py	(original)
+++ cdd/trunk/webtools/cddtasktools.py	Thu Jun 26 08:08:07 2008
@@ -85,7 +85,9 @@
             # we have to remove the gettext _() call which was inserted into the config
             # file to enable easy input for config file editors - but the call has to
             # be made explicitely in the python code
-            ret['advertising'] = re.sub('_\(\W?(.+)\W?\)', '\\1', stanza['advertising'])
+            advertising = re.sub('_\(\W(.+)\W\)', '\\1', stanza['advertising'])
+            # gettext needs to escape '"' thus we need to remove the escape character '\'
+            ret['advertising'] = re.sub('\\\\"', '"', advertising)
 
     return ret
 

Modified: cdd/trunk/webtools/tasks.py
==============================================================================
--- cdd/trunk/webtools/tasks.py	(original)
+++ cdd/trunk/webtools/tasks.py	Thu Jun 26 08:08:07 2008
@@ -92,9 +92,13 @@
 	data['howtosetlang']       = _('How to set <a href="%s">the default document language</a>')
 	data['howtosetlang']       = Markup(data['howtosetlang'] % ('http://www.debian.org/intro/cn.%s.html' % lang))
 	if data['advertising'] != None:
+		# If data['advertising'] is enclosed in _() gettext tries to ask for translations of 'advertising'
+		# which makes no sense.  That's why this is masked by an extra string variable
 		advertising = data['advertising']
-		data['projectadvertising'] = _(advertising) # Hopefully translation will work this way ...
-		print "DEBUG", data['projectadvertising'], data['advertising']
+		##data['projectadvertising'] = _(advertising) # Hopefully translation will work this way ...
+		# Genshi needs explicite information that it is dealing with an UTF-8 string which should not be changed
+		advertising = _(advertising)
+		data['projectadvertising'] = Markup(unicode(advertising))# , 'utf-8'))
 
 	COLORCODES = { 'official'      : _('Green: The project is <a href="#official-debs">available as an official Debian package</a>'),
     		       'unofficial'    : _('Yellow: The project is <a href="#unofficial-debs">available as an unofficial Debian package</a>'),

Modified: cdd/trunk/webtools/templates/tasks_idx.xhtml
==============================================================================
--- cdd/trunk/webtools/templates/tasks_idx.xhtml	(original)
+++ cdd/trunk/webtools/templates/tasks_idx.xhtml	Thu Jun 26 08:08:07 2008
@@ -51,6 +51,7 @@
 		</div>
 	</td>
 </tr>
+</table>
 <div id="footer">
   <hr class="hidecss" />
 <p>${langavail}</p>
@@ -62,6 +63,5 @@
 <p>${howtosetlang}</p>
   <address>${updatetimestamp}</address>
 </div>
-</table>
 </body>
 </html>



More information about the Cdd-commits mailing list