import json


def fluent_list_output(value):
    """
    Return stored json representation as a multilingual dict, if
    value is already a dict just pass it through.
    """
    if isinstance(value, dict):
        return value
    try:
        result = json.loads(value)
        return {k: v if isinstance(v, list) else [v] for k, v in list(result.items())}

    except ValueError:
        # plain string in the db, return as is so it can be migrated
        return value