Mapper that takes a language field, its value and returns the
    related lookup for Translation model.

def get_translation_lookup(identifier, field, value):
    """
    Mapper that takes a language field, its value and returns the
    related lookup for Translation model.
    """
    # Split by transformers
    parts = field.split("__")

    # Store transformers
    transformers = parts[1:] if len(parts) > 1 else None

    # defaults to "title" and default language
    field_name = parts[0]
    language = get_fallback_language()

    name_parts = parts[0].split("_")
    if len(name_parts) > 1:
        supported_languages = get_supported_languages()
        last_part = name_parts[-1]
        if last_part in supported_languages:
            # title_with_underscore_fr?
            field_name = "_".join(name_parts[:-1])
            language = last_part
        else:
            # title_with_underscore?
            # Let's use default language
            field_name = "_".join(name_parts)

    value_lookup = (
        "field_value"
        if transformers is None
        else "field_value__%s" % "__".join(transformers)
    )

    lookup = {"field_name": field_name, "identifier": identifier, "language": language}

    lookup[value_lookup] = value

    return lookup