def METHOD_NAME(ref, language, project):
    if not ref.startswith(project.sanitized_name + '/'):
        return language + '/' + ref
    p = pathlib.Path(ref)
    return str(pathlib.Path(p.parts[0], language, *p.parts[1:]))