'Yield (translation_class, data for INSERT) pairs for loading into the DB
langs is either a list of language identifiers or None'

def get_load_data(self, langs=None):

    if (langs is None):
        langs = self.language_identifiers.values()
    stream = Merge()
    for lang in self.language_identifiers.values():
        stream.add_iterator(self.yield_target_messages(lang))
    stream = (message for message in stream if (not message.official))
    count = 0
    class GroupDict(dict, ):
        'Dict    to    automatically    set    the    foreign_id    and    local_language_id    for    new    items\n                                                '
        def __missing__(self, key):
            (id, language_id) = key
            data = self[key] = defaultdict((lambda : None))
            column_names = (c.name for c in translation_class.__table__.columns)
            data.update(dict.fromkeys(column_names))
            data.update({('%s_id' % cls.__singlename__): id, 'local_language_id': language_id})
            return data
    everything = defaultdict(GroupDict)
    for ((cls_name, id), group) in group_by_object(stream):
        cls = toplevel_class_by_name[cls_name]
        for message in group:
            translation_class = translation_class_by_column[(cls, message.colname)]
            key = (id, message.language_id)
            colname = str(message.colname)
            everything[translation_class][key][colname] = message.string
            count += 1
        if (count > 1000):
            for (translation_class, key_data) in everything.items():
                (yield (translation_class, list(key_data.values())))
            count = 0
            everything.clear()
    for (translation_class, data_dict) in everything.items():
        (yield (translation_class, list(data_dict.values())))
