[gen] Bugfixin the sync of i18n files; allow to include XHTML within messages in Appy popups.

This commit is contained in:
Gaetan Delannay 2014-03-26 14:01:03 +01:00
parent 834817c27b
commit d5a9450d72
3 changed files with 9 additions and 3 deletions

View file

@ -449,8 +449,9 @@ class ZopeGenerator(Generator):
baseLabels = po.PoParser(appyPoFileName).parse().messages baseLabels = po.PoParser(appyPoFileName).parse().messages
else: else:
baseLabels = appyLabels baseLabels = appyLabels
poFile.update(baseLabels + self.labels.get(), poFile.update(baseLabels + self.labels.get() + \
self.options.i18nClean, keepExistingOrder=False) potFile.getCustomMessages(), self.options.i18nClean,
keepExistingOrder=False)
poFile.generate() poFile.generate()
# Generate corresponding fields on the Translation class # Generate corresponding fields on the Translation class
page = '1' page = '1'

View file

@ -276,6 +276,11 @@ class PoFile:
res = '%s-%s-%s.po' % (self.applicationName, self.domain, language) res = '%s-%s-%s.po' % (self.applicationName, self.domain, language)
return res return res
def getCustomMessages(self):
'''Returns, the list of messages from self.messages whose ID starts with
"custom_".'''
return [m for m in self.messages if m.id.startswith('custom_')]
class PoParser: class PoParser:
'''Allows to parse a i18n file. The result is produced in self.res as a '''Allows to parse a i18n file. The result is produced in self.res as a
PoFile instance.''' PoFile instance.'''

View file

@ -570,7 +570,7 @@ class AbstractWrapper(object):
layoutTarget=obj">:tool.pxLayoutedObject</x> layoutTarget=obj">:tool.pxLayoutedObject</x>
</form> </form>
<script type="text/javascript" <script type="text/javascript"
if="confirmMsg">:'askConfirm(%s,%s,%s)' % \ if="confirmMsg">::'askConfirm(%s,%s,%s)' % \
(q('script'), q('postConfirmedEditForm()'), q(confirmMsg))</script> (q('script'), q('postConfirmedEditForm()'), q(confirmMsg))</script>
<x>:tool.pxPageBottom</x> <x>:tool.pxPageBottom</x>
</x>''', template=pxTemplate, hook='content') </x>''', template=pxTemplate, hook='content')