'Add or update the message with the specified ID.
>>> catalog = Catalog()
>>> catalog[u\'foo\'] = Message(u\'foo\')
>>> catalog[u\'foo\']
<Message u\'foo\' (flags: [])>
If a message with that ID is already in the catalog, it is updated
to include the locations and flags of the new message.
>>> catalog = Catalog()
>>> catalog[u\'foo\'] = Message(u\'foo\', locations=[(\'main.py\', 1)])
>>> catalog[u\'foo\'].locations
[(\'main.py\', 1)]
>>> catalog[u\'foo\'] = Message(u\'foo\', locations=[(\'utils.py\', 5)])
>>> catalog[u\'foo\'].locations
[(\'main.py\', 1), (\'utils.py\', 5)]
:param id: the message ID
:param message: the `Message` object'

def __setitem__(self, id, message):

    assert isinstance(message, Message), 'expected    a    Message    object'
    key = self._key_for(id)
    current = self._messages.get(key)
    if current:
        if (message.pluralizable and (not current.pluralizable)):
            current.id = message.id
            current.string = message.string
        current.locations = list(distinct((current.locations + message.locations)))
        current.auto_comments = list(distinct((current.auto_comments + message.auto_comments)))
        current.user_comments = list(distinct((current.user_comments + message.user_comments)))
        current.flags |= message.flags
        message = current
    elif (id == ''):
        headers = message_from_string(message.string.encode(self.charset))
        self.mime_headers = headers.items()
        self.header_comment = '\n'.join([('#    %s' % comment) for comment in message.user_comments])
        self.fuzzy = message.fuzzy
    else:
        if isinstance(id, (list, tuple)):
            assert isinstance(message.string, (list, tuple)), ('Expected    sequence    but    got    %s' % type(message.string))
        self._messages[key] = message
