import json


def load_translations(translation_file):
    """Loads translations from the given file and returns them as a map"""
    translations = json.load(translation_file)
    for slug, translation in list(translations.items()):
        del translations[slug]
        translations[slug.replace('\n', '\\n')] = translation.replace('\n', '\\n')
    return translations