diff --git a/gen/generator.py b/gen/generator.py index 39dde64..67cc99b 100644 --- a/gen/generator.py +++ b/gen/generator.py @@ -449,8 +449,9 @@ class ZopeGenerator(Generator): baseLabels = po.PoParser(appyPoFileName).parse().messages else: baseLabels = appyLabels - poFile.update(baseLabels + self.labels.get(), - self.options.i18nClean, keepExistingOrder=False) + poFile.update(baseLabels + self.labels.get() + \ + potFile.getCustomMessages(), self.options.i18nClean, + keepExistingOrder=False) poFile.generate() # Generate corresponding fields on the Translation class page = '1' diff --git a/gen/po.py b/gen/po.py index a1c0152..2d5bf03 100644 --- a/gen/po.py +++ b/gen/po.py @@ -276,6 +276,11 @@ class PoFile: res = '%s-%s-%s.po' % (self.applicationName, self.domain, language) 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: '''Allows to parse a i18n file. The result is produced in self.res as a PoFile instance.''' diff --git a/gen/wrappers/__init__.py b/gen/wrappers/__init__.py index c47b5d6..7579d49 100644 --- a/gen/wrappers/__init__.py +++ b/gen/wrappers/__init__.py @@ -570,7 +570,7 @@ class AbstractWrapper(object): layoutTarget=obj">:tool.pxLayoutedObject :tool.pxPageBottom ''', template=pxTemplate, hook='content')