diff options
-rw-r--r-- | tools/grit/grit/node/message.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/grit/grit/node/message.py b/tools/grit/grit/node/message.py index 9410f93..8cdf0ef 100644 --- a/tools/grit/grit/node/message.py +++ b/tools/grit/grit/node/message.py @@ -99,12 +99,15 @@ class MessageNode(base.ContentNode): return self.attrs['translateable'] == 'true' def ItemFormatter(self, t): + # Only generate an output if the if condition is satisfied. + if not self.SatisfiesOutputCondition(): + return super(type(self), self).ItemFormatter(t) + if t == 'rc_header': return grit.format.rc_header.Item() - elif (t in ['rc_all', 'rc_translateable', 'rc_nontranslateable'] and - self.SatisfiesOutputCondition()): + elif t in ('rc_all', 'rc_translateable', 'rc_nontranslateable'): return grit.format.rc.Message() - elif t == 'js_map_format' and self.SatisfiesOutputCondition(): + elif t == 'js_map_format': return grit.format.js_map_format.Message() else: return super(type(self), self).ItemFormatter(t) |