Flattens an nested array of translations.

        The scheme used is:
          'key' => array('key2' => array('key3' => 'value'))
        Becomes:
          'key.key2.key3' => 'value'

        This function takes an array by reference and will modify it

        @type messages: dict
        @param messages: The dict that will be flattened

        @type parent_key: str
        @param parent_key: Current path being parsed, used internally for recursive calls

def flatten(self, messages, parent_key=''):
        """
        Flattens an nested array of translations.

        The scheme used is:
          'key' => array('key2' => array('key3' => 'value'))
        Becomes:
          'key.key2.key3' => 'value'

        This function takes an array by reference and will modify it

        @type messages: dict
        @param messages: The dict that will be flattened

        @type parent_key: str
        @param parent_key: Current path being parsed, used internally for recursive calls
        """
        items = []
        sep = '.'
        for k, v in list(messages.items()):
            new_key = "{0}{1}{2}".format(parent_key, sep, k) if parent_key else k
            if isinstance(v, collections.MutableMapping):
                items.extend(list(self.flatten(v, new_key).items()))
            else:
                items.append((new_key, v))
        return dict(items)