def get_i18n_block(inifile_or_dict, key, pop=False):
    """Extracts an i18n block from an ini file or dictionary for a given
    key. If "pop", delete keys from "inifile_or_dict".
    """
    rv = {}
    for k in list(inifile_or_dict):
        if k == key:
            rv['en'] = inifile_or_dict.pop(k) if pop else inifile_or_dict[k]
        elif k.startswith(key + '['):
            rv[k[len(key) + 1:-1]] = inifile_or_dict.pop(k
                ) if pop else inifile_or_dict[k]
    return rv
