comparison babel/messages/catalog.py @ 70:2b0e18a04856

Fix for mixed singular/plural messages, follow-up to [70].
author cmlenz
date Fri, 08 Jun 2007 16:22:10 +0000
parents 9b8079807245
children ee043bb666f0
comparison
equal deleted inserted replaced
69:9b8079807245 70:2b0e18a04856
47 """ 47 """
48 self.id = id 48 self.id = id
49 if not string and self.pluralizable: 49 if not string and self.pluralizable:
50 string = (u'', u'') 50 string = (u'', u'')
51 self.string = string 51 self.string = string
52 self.locations = locations 52 self.locations = list(locations)
53 self.flags = set(flags) 53 self.flags = set(flags)
54 if id and self.python_format: 54 if id and self.python_format:
55 self.flags.add('python-format') 55 self.flags.add('python-format')
56 else: 56 else:
57 self.flags.discard('python-format') 57 self.flags.discard('python-format')
307 current = self._messages.get(key) 307 current = self._messages.get(key)
308 if current: 308 if current:
309 if message.pluralizable and not current.pluralizable: 309 if message.pluralizable and not current.pluralizable:
310 # The new message adds pluralization 310 # The new message adds pluralization
311 current.id = message.id 311 current.id = message.id
312 current.string = message.string
312 current.locations.extend(message.locations) 313 current.locations.extend(message.locations)
313 current.flags |= message.flags 314 current.flags |= message.flags
314 message = current 315 message = current
315 else: 316 else:
316 if isinstance(id, (list, tuple)): 317 if isinstance(id, (list, tuple)):
Copyright (C) 2012-2017 Edgewall Software