import typing


def get_translation_dict(
    other_name: str, variable_translation: dict
) -> typing.Optional[dict]:
    """Returns the translation dict or None if no translation necessary."""
    # Translate if variable_translation exists
    if variable_translation is None:
        translate_dict = None
    else:
        try:
            # Sometimes not all variables are translated,
            # Only set translate to true if this variable has a translation dict
            translate_dict = variable_translation[other_name]
        except KeyError:
            translate_dict = None
    return translate_dict