appy.shared: added support for country codes (iso-3166-1) - appy.gen: non-string variables are now allowed in i18n variable replacements; bugfix while browsing translation pages with the 'next' arrows in 'edit' mode.

This commit is contained in:
Gaetan Delannay 2011-04-26 20:49:33 +02:00
parent 4e848ce0a8
commit 9e7ddcc771
7 changed files with 298 additions and 14 deletions

View file

@ -1245,6 +1245,7 @@ class BaseMixin:
res = self.formatText(res, format)
# Perform variable replacements
for name, repl in mapping.iteritems():
if not isinstance(repl, basestring): repl = str(repl)
res = res.replace('${%s}' % name, repl)
return res

View file

@ -563,8 +563,6 @@
<td width="80%">
<b class="appyTitle" tal:content="contextObj/title_or_id"></b>
</td>
<td><metal:actions use-macro="here/document_actions/macros/document_actions"/>
</td>
</tr>
<tr tal:define="descrLabel python: contextObj.translate('%s_edit_descr' % contextObj.portal_type)"
tal:condition="descrLabel/strip" align="left">

View file

@ -22,9 +22,10 @@ class TranslationWrapper(AbstractWrapper):
else:
sourceMsg = getattr(sourceTranslation,fieldName)
# When editing the value, we don't want HTML code to be interpreted.
# This way, the translator sees the HTML tags and can reproduce them in
# the translation.
if self.request['URL'].endswith('/skyn/edit'):
# This way, the translator sees the HTML tags and can reproduce them
# in the translation.
url = self.request['URL']
if url.endswith('/skyn/edit') or url.endswith('/skyn/do'):
sourceMsg = sourceMsg.replace('<','&lt;').replace('>','&gt;')
sourceMsg = sourceMsg.replace('\n', '<br/>')
return '<div class="translationLabel"><acronym title="%s">' \