def other_lang_URL(folder, basename, lang):
    """Returns a relative link from the file 'basename' in 'folder' to the
    the same file in the language version 'lang'.
    """
    path = []
    while folder.parent:
        path.append(folder.metadata['foldername'])
        folder = folder.parent
    path.append(lang)
    path.extend(['..'] * len(path))
    path.reverse()
    path.append(basename + ".html")
    return "/".join(path)